1
我正在尝试使用BeautifulSoup在维基百科页面中找到一张表格,出于某种原因,我没有收到表格。 任何人都可以告诉我为什么我不拿桌子吗?beautifulsoup-找到指定类别的表格
我的代码:
import BeautifulSoup
url='https://en.wikipedia.org/wiki/List_of_National_Historic_Landmarks_in_Louisiana'
r=requests.get(url)
url=r.content
soup = BeautifulSoup(url,'html.parser')
tab=soup.find("table",{"class":"wikitable sortable jquery-tablesorter"})
print tab
打印:无
你能明确指定你正在使用的模块吗? 'requests.get'从哪里来? – DJJ
@DJJ'requests.get'来自[请求库](http://docs.python-requests.org/en/latest/) – Celeo