【发布时间】:2026-02-12 02:35:02
【问题描述】:
我正在循环遍历 <td> 类型的元素,但我正在努力提取 <td> 文本。
HTML:
<td class="cell">
Brand Name 1
<br/>
(
<a class="tip" title="This title">
Authorised Resellers
</a>
)
</td>
:期望的输出:
Brand name: Brand name 1
Brand distribution type: Authorised Reseller
我试过了:
for brand in brand_loop:
print(brand.text)
但这不会打印开始 <td> 标记(“品牌名称 1”)之后的文本。
有什么建议吗?谢谢!
【问题讨论】:
标签: python beautifulsoup