我在使用bs4 Python 3的站点中找不到表

2024-10-02 00:20:01 发布

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

我正在解析sitehttps://rutracker.org/forum/viewtopic.php?t=4804331(俄语的site,但没关系)。我想取“href”作为对象Скачать .下载文件的“torrent”(图中圈出)。这是一排桌子。我试着找到bs4的桌子。一开始,我试着找到了所有的桌子,然后拿了一张。但我找不到这张桌子。发生了什么?也许,因为剧本里

import requests, bs4
link='https://rutracker.org/forum/viewtopic.php?t=4804331'
res=requests.get(link)
res.raise_for_status()
soup=bs4.BeautifulSoup(res.text,'html.parser')
table=soup.find_all('table')
for t in table:
    print(t)

image


Tags: orgfortablelinksiteresforumrequests

热门问题