【发布时间】:2021-01-21 15:05:15
【问题描述】:
我正在尝试抓取具有以下标签的网页:
<div style="text-align: center;">
<img src="https://documents.google.com/" alt="" width="60" height="30" />
<br />
Pick me please.
<p> Do not pick me please! </p>
<br />
<br />
</div>
我想抓取“请接我”字符串,但不想抓取“请不要接我!”细绳。知道怎么做吗?
编辑:我希望有一个更通用的解决方案,我总是希望在特定标签下获取文本,该标签不在任何子标签内
【问题讨论】:
标签: python python-3.x web-scraping beautifulsoup web-crawler