我的 html 页面有:
...
<table class="t1" ..>
<tr><td> ... <a href="">...</a> ... <a href="">..</a>
</table>
...
我有:
html = BeautifulSoup(page)
links = html.findAll('a', ?????????)
如何找到该表中的所有链接?
最佳答案
找到表格(在本例中为 by class),然后找到其中的所有链接。
html = BeautifulSoup(page)
table = html.find('table', 't1')
links = table.findAll('a')
关于python - 查找表格内的所有链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4940885/