pythonBeautifulSoup怎么获取无标签文本,beautifulsoup爬虫教程

首页 > 生活 > 作者:YD1662025-06-12 06:47:10

pythonBeautifulSoup怎么获取无标签文本,beautifulsoup爬虫教程(1)

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

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

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.