Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用BeautifulSoup获取空列表进行Web抓取_Python_Web Scraping_Beautifulsoup - Fatal编程技术网

Python 使用BeautifulSoup获取空列表进行Web抓取

Python 使用BeautifulSoup获取空列表进行Web抓取,python,web-scraping,beautifulsoup,Python,Web Scraping,Beautifulsoup,使用BeautifulSoup进行刮取时获取空列表 代码和输出如下所示 出什么问题了?试试这个: table = soup.find_all('table', {'id': 'table3'}) 希望能有所帮助。您确定响应中的类c_district有什么内容吗?是的,有带地区名称和编号的跨距,但页面没有c_district类,我不确定find\u all\u next方法是否没有class\u参数。@gogulcv如果你ctrl+u和ctrl+f并搜索c\u区,你将找不到任何东西。如果页面使

使用BeautifulSoup进行刮取时获取空列表 代码和输出如下所示

出什么问题了?

试试这个:

table = soup.find_all('table', {'id': 'table3'})

希望能有所帮助。

您确定响应中的类
c_district
有什么内容吗?是的,有带地区名称和编号的跨距,但页面没有
c_district
类,我不确定
find\u all\u next
方法是否没有
class\u
参数。@gogulcv如果你
ctrl+u
ctrl+f
并搜索
c\u区
,你将找不到任何东西。如果页面使用JavaScript更新内容,则应该考虑使用Sele.