【发布时间】:2015-07-04 20:08:09
【问题描述】:
我希望从网站上抓取两个值。这些存在于以下标签中:
<span class="sp starBig">4.1</span>
<span class="sp starGryB">2.9</span>
我需要值 sp starBig、sp starGryB。
我使用的 findAll 表达式是 -
soup.findAll('span', {'class': ['sp starGryB', 'sp starBig']}):
代码执行没有任何错误,但没有显示结果。
【问题讨论】:
-
您使用的是哪个版本的 BeautifulSoup?
-
最后有个':'..
-
你需要 of sp starBig 和 sp starGryB 的值吗?
-
@skyline75489 抱歉。我不确定它是哪个版本。我怎么知道?我是新手。
-
你是导入 bs4 还是 BeautifulSoup?
标签: python beautifulsoup