查找表中的所有链接

Bla*_*man 3 python beautifulsoup

我的html页面具有:

...
<table class="t1" ..>
<tr><td> ... <a href="">...</a> ... <a href="">..</a>
</table>

...
Run Code Online (Sandbox Code Playgroud)

我有:

html = BeautifulSoup(page)

links = html.findAll('a', ?????????)
Run Code Online (Sandbox Code Playgroud)

如何找到此表内的所有链接?

Jon*_*nan 6

查找表(在这种情况下,按类),然后查找表中的所有链接。

html = BeautifulSoup(page)
table = html.find('table', 't1')
links = table.findAll('a')
Run Code Online (Sandbox Code Playgroud)