'我是刮新的。我想抓取 2018-19 赛季英超联赛结果(赛程、结果、日期),但我很难浏览网站。我得到的只是空列表/[无]。如果你有一个可以分享的解决方案,那将是一个很大的帮助。'
“这就是我试过的。”
'''
import pandas as pd
import requests as uReq
from bs4 import BeautifulSoup
url = uReq.get('https://www.flashscore.com/football/england/premier-league-2018-2019/results/')
soup = BeautifulSoup(url.text, 'html.parser')
divs = soup.find_all('div', attrs={'id': 'live-table'})
Home = []
for div in divs:
anchor = div.find(class_='event__participant event__participant--home')
Home.append(anchor)
print(Home)
Run Code Online (Sandbox Code Playgroud)
'''