Python 2.7 无法使用BeautifulSoup刮取h3标签
该网址为: 我想在第一页中提取所有匹配结果的链接,我相信相应的html是:Python 2.7 无法使用BeautifulSoup刮取h3标签,python-2.7,beautifulsoup,Python 2.7,Beautifulsoup,该网址为: 我想在第一页中提取所有匹配结果的链接,我相信相应的html是: <h3 class="newaps"> <a href="https://rads.stackoverflow.com/amzn/click/com/1600490069" rel="nofollow noreferrer"> <span class="lrg bold"> … </span> </a> <span cla
<h3 class="newaps">
<a href="https://rads.stackoverflow.com/amzn/click/com/1600490069" rel="nofollow noreferrer">
<span class="lrg bold"> … </span>
</a>
<span class="med reg"> … </span>
</h3>
我不确定我在这里做错了什么?您使用的是什么版本的beautifulsoup?从bs4导入beautifulsoup
In [39]: url = "http://www.amazon.com/s/field-keywords=machine%20learning"
In [40]: page = urllib2.urlopen(url)
In [42]: html = page.read()
In [44]: soup = BeautifulSoup(html)
In [45]: soup.findAll('h3',{'class': 'newaps'})
Out[45]: []