我正在抓取此页面https://www.betexplorer.com/soccer/netherlands/eerste-divisie-2018-2019/results/我想提取比赛、结果和日期。我使用了这段代码:
df=[]
matches=driver.find_elements_by_xpath("//a[@class='in-match']")
for match in range(len(matches)):
df.append(matches[match].text)
results=driver.find_elements_by_xpath("//td[@class='h-text-center']")
for result in range(len(results)):
df.append(results[result].text)
date=driver.find_elements_by_xpath("//td[contains(@class, 'h-text-right')]")
for data in range(len(date)):
df.append(date[data].text)
df = pd.DataFrame(df, columns=[['match', 'result', 'data']])
我想导出到数据框,但出现此错误ValueError: Shape of passed values is (24, 1), indices imply (24, 3)
LEATH
相关分类