|
发表于 2017-2-11 09:14:44
|
显示全部楼层
import urllib.request
url='http://www.whatismyip.com.tw'
proxy_support=urllib.request.ProxyHandler({'http':'218.75.100.114'})
opener = urllib.request.build_opener(proxy_support)
urllib.request.install_opener(opener)
response = urllib.request.urlopen(url)
html = response.read().decode('utf-8')
print(html)
错误:
Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/python 练习2.0/proxy.py", line 12, in <module>
html = response.read().decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb7 in position 209: invalid start byte
[/code]55课视频教学中发生如下错误,不理解,请教楼主 |
|