【发布时间】:2026-01-03 16:30:01
【问题描述】:
我想获取 HTML 文档中的特定行
行具有以下属性集:bgcolor 和 vallign
这是 HTML 表格的 sn-p:
<table>
<tbody>
<tr bgcolor="#f01234" valign="top">
<!--- td's follow ... -->
</tr>
<tr bgcolor="#c01234" valign="top">
<!--- td's follow ... -->
</tr>
</tbody>
</table>
我快速浏览了BS's documentation。不清楚要传递给 findAll 的参数以匹配我想要的行。
有谁知道 findAll() 用什么 tp bass 来匹配我想要的行?
【问题讨论】:
-
根据其他人之前的挣扎修改了问题。现在使用 BeautifulSoup
-
请让您的问题的标题更具体。
标签: python html-parsing beautifulsoup