求助!为什么在PYthon用代理IP就会报错。上图
报错如下图代码:
import urllib.request
import random
url = 'http://www.fishc.com'
iplist = ['58.213.19.233:10081']
proxy_support = urllib.request.ProxyHandler({'http':random.choice(iplist)})
opener = urllib.request.build_opener(proxy_support)
opener.addheaders = [('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 UBrowser/5.7.16400.16 Safari/537.36')]
urllib.request.install_opener(opener)
response = urllib.request.urlopen(url)
html = response.read().decode('utf-8')
print(html)
这是为什么呀,求救{:10_266:}
自顶一下 我换了一个ip可以 换成可用的代理IP就行了,去网上找最新的
换最新代理就好了
页:
[1]