登录

python 爬虫

tml = """
<div class="bd">
<p class>
hello

thank
</p>
"""

bs = BeautifulSoup(html, 'html.parser')
p = bs.find('p').string
print(p)

输出结果是 None为什么呢?

1.png

# Python
高洛峰 高洛峰 2733 天前 778 次浏览

全部回复(1) 我要回复

  • 三叔

    三叔2016-10-22 16:12:59

    1.png

    可以获取hello thank啊,没有None


    回复
    0
  • 取消 回复 发送