【发布时间】:2019-02-20 11:45:06
【问题描述】:
我需要一种方法来检索特定的“td”标签,其文本内容位于属于同一“tr”行的特定“th”标签下。这是结构的样子:
<tr>...Not interested in this row...</tr>
<tr>...Not interested in this row...</tr>
<tr>
<th>Titletext</th>
<td class="rightalign right">64663438434</td>
</tr>
<tr>...Not interested in this row...</tr>
<tr>...Not interested in this row...</tr>
我想通过 'th' 标签搜索,并检索它下面的 'td' 标签内的数字。有什么想法吗?
【问题讨论】:
标签: python web-scraping beautifulsoup