【发布时间】:2019-07-18 10:27:19
【问题描述】:
\试图从此 html 中获取文本 A Plus 和 Computers:
<div class="u-space-t1">
<h1 class="biz-page-title embossed-text-white shortenough">A Plus</h1>
<div class="u-inline-block">
<h1 class="biz-page-title\ embossed-text-white\ shortenough">Computers</h1>
<div class="u-inline-block">
所以我试着得到这样的文字:
c = soup.findAll('h1',{"class":"biz-page-title embossed-text-white shortenough"})
print(c)
但是我得到一个空列表
我也试过这样做:
c = soup.find('div', class_='u-inline-block').h1
我得到一个未找到的“Nonetype”对象。
【问题讨论】:
标签: html python-3.x python-2.7 web-scraping beautifulsoup