pythonBeautifulSoup怎么获取无标签文本

更新时间:02-03 教程 由 忘殇 分享

pythonBeautifulSoup怎么获取无标签文本?

因为你的html不是合法的xml格式,标签没有成对出现,只能用html解析器from bs4 import BeautifulSoup s = """714659079qqcom 2014/09/10 10:14

"""soup = BeautifulSoup(s, "html.parser")print soupprint soup.get_text()

声明:关于《pythonBeautifulSoup怎么获取无标签文本》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2278987.html