Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- page=requests.get('https://www.fifa.com/worldcup/matches/?cid=go_box')
- soup = BeautifulSoup(page.text,'html.parser')
- #items = []
- rows = soup.find_all('a', class_='fi-mu__link')
- for row in rows:
- date = row.find('div', class_='fi-mu__info__datetime')
- date = date.text[7:20]
- teams = row.find_all('span', class_='fi-t__nText')
- team1 = teams[0].text
- team2 = teams[1].text
- #items.append( [date, team1, team2] )
- print('Date:', date)
- print(f'Teams: {team1} VS {team2}')
- print('---------------------------------')
- #for date, team1, team2 in items:
- # print('Date:', date)
- # print(f'Teams: {team1} VS {team2}')
- # print('---------------------------------')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement