如何为网站表使用pd.read_html

2024-10-01 02:18:46 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我有下面的桌子,我想擦一下:

https://www.footballdb.com/players/current.html?letter=B

enter image description here

我尝试使用以下代码进行刮取:

df= pd.DataFrame()
site= 'https://www.footballdb.com/players/current.html?letter=B'
df = pd.read_html(site)

但是,我得到了一个错误:

ValueError: No tables found

有人能解决这个错误吗

我可以看到div class = "divtable divtable-striped"但是不确定如何提取

任何帮助都将不胜感激!谢谢


Tags: 代码httpscomdfhtmlwww错误site