File tree 1 file changed +5
-4
lines changed
20191008/Exercises/.ipynb_checkpoints
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 31
31
"outputs" : [],
32
32
"source" : [
33
33
" www = 'https://www.olympic.org'\n " ,
34
- " r = requests.get(f'{www}/sport ')\n " ,
34
+ " r = requests.get(f'{www}/sports ')\n " ,
35
35
" soup = BeautifulSoup(r.text,'lxml')\n " ,
36
36
" \n " ,
37
- " for sport in soup.select('ul.countries li'):\n " ,
37
+ " summergames = soup.select(\" #summer-sports a\" )\n " ,
38
+ " for sport in summergames:\n " ,
38
39
" print(sport.text.strip())"
39
40
]
40
41
},
66
67
"outputs" : [],
67
68
"source" : [
68
69
" # Then loop through all sports\n " ,
69
- " for sport in soup.select('ul.countries li '):\n " ,
70
- " sp = sport.a ['href']\n " ,
70
+ " for sport in soup.select('#summer-sports a '):\n " ,
71
+ " sp = sport['href']\n " ,
71
72
" r = requests.get(f'{www}{sp}')\n " ,
72
73
" s = BeautifulSoup(r.text,'lxml')\n " ,
73
74
" for i in s.select('section.sport-events ul li'):\n " ,
You can’t perform that action at this time.
0 commit comments