繁体   English   中英

BeautifulSoup Soup findall仅提取类数据

[英]BeautifulSoup Soup findall extract only the class data

我想只提取<>标记之间的类行中的数据,html行是:

[<h4 class="jobsearch-CompanyReview--heading">ABC</h4>]

我正在使用此代码,但它返回了竞争行,我只想要字符串的ABC部分。

company = soup.find_all("h4", class_ ="jobsearch-CompanyReview--heading")

我怎样才能从html字符串中删除数据?

company = soup.find_all("h4", class_ ="jobsearch-CompanyReview--heading")[0].text

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM