1 2 3 4 5 6 7 8 9
import urllib.request #确定需要获取数据的url url = "html://www.baidu.com" #通过urllib获取数据 response = urllib.request.urlopen(url) #读取数据 data = response.read() print(data) print(type(data))
1 2
Line 2 SyntaxError: Non-ASCII character '\xe7' in file t.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details