我如何定位 BS4 以在 <h3>64-bit deb for Ubuntu/Debian</h3>
之后的表格开始? ?有很多表,唯一不同的是表头。
<h3>Windows 64-bit</h3>
<table width="600" border="1" align="center">
:
</table>
:
<h3>64-bit deb for Ubuntu/Debian</h3>
<table width="600" border="1" align="center">
:
</table>
:
最佳答案
这行得通吗?
>>> for header in soup.find_all('h3'):
... if header.get_text() == '64-bit deb for Ubuntu/Debian':
... header.find_next_sibling()
...
<table align="center" border="1" width="600">
:
</table>
关于python - BeautifulSoup 在特定标题后得到表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57655108/