如何使用Python获取桌子的身体?
我正在自我播放的网络crap绕,我正试图从一个美丽的小屋的桌子上拿到tbody。 我的尝试:
url ='https://www.agrolok.pl/notowania/notowania-cen-pszenicy.htm'
page = requests.get(url).content
soup = BeautifulSoup(page, 'lxml')
table = soup.findAll('table', class_='hover')
print(table)
那就是我得到的:
<table class="hover"></table>
任何提示都高度赞赏
I am self-lerning webscraping and I am trying to get tbody from a table with beautifulSoups.
My attempt:
url ='https://www.agrolok.pl/notowania/notowania-cen-pszenicy.htm'
page = requests.get(url).content
soup = BeautifulSoup(page, 'lxml')
table = soup.findAll('table', class_='hover')
print(table)
Thats what I get:
<table class="hover"></table>
Any hints highly appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
'表',class _ ='hover'
包含表数据aka tbody,tr,td等是动态的,这就是为什么您无法获得tbody
,但您可以模仿DAT硒与熊猫/BS4。我将硒与熊猫一起使用。脚本:
输出:
'table', class_='hover'
that contains table data aka tbody, tr, td and so on are dynamic thats why you are not gettingtbody
but you can mimic dat selenium with pandas/bs4. I use selenium with pandas.Script:
Output: