【发布时间】:2020-06-25 19:24:59
【问题描述】:
Picture contains HTML code for the situation
案例一:
<li>
<a> some text: </a><strong> 'identifier:''random words' </strong>
</li>
案例2:
<li>
<a> some text: </a>
</li>
如果存在标识符,我想抓取它的值,否则如果在特定情况下没有标识符,我想放置一个空字符串。 我正在使用scrapy,或者您也可以帮助我使用 BeautifulSoup,非常感谢您的帮助
【问题讨论】:
标签: python-3.x web-scraping beautifulsoup scrapy