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怎么獲取無標簽文本?
因為你的html不是合法的xml格式,標簽沒有成對出現,只能用html解析器from bs4 import BeautifulSoup s = """714659079qqcom 2014/09/10 10:14
"""soup = BeautifulSoup(s, "html.parser")print soupprint soup.get_text()