【发布时间】:2015-06-19 01:21:49
【问题描述】:
我正在使用 Python3,BeautifulSoup4
当我在下面运行代码时,它只给出 url "www.google.com" 而不是 XML。 没找到怎么回事。
from bs4 import BeautifulSoup
import urllib
html = "www.google.com"
soup = BeautifulSoup(html)
print (soup.prettify())
【问题讨论】:
-
"www.google.com"不是 HTML。使用urllib2或requests下载HTML。 -
请再次阅读您遵循的教程/文档
标签: python python-3.x beautifulsoup