【问题标题】:BeautifulSoup Soup findall extract only the class dataBeautifulSoup Soup findall 只提取类数据
【发布时间】:2019-03-24 23:33:57
【问题描述】:

我只想提取标签之间的class行中的数据,html行是:

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

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

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

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

【问题讨论】:

    标签: python html beautifulsoup python-beautifultable


    【解决方案1】:
    company = soup.find_all("h4", class_ ="jobsearch-CompanyReview--heading")[0].text
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-12
      • 2017-08-03
      • 2012-05-18
      • 2017-01-21
      • 1970-01-01
      • 2014-08-05
      • 2016-03-26
      • 2020-04-25
      相关资源
      最近更新 更多