python 3 urllib Proxy Authentication Required

proxy = urllib.request.ProxyHandler({'http': 'http://username:password@host:post'})
auth = urllib.request.HTTPBasicAuthHandler()
opener = urllib.request.build_opener(proxy, auth, urllib.request.HTTPHandler)
urllib.request.install_opener(opener)
conn = urllib.request.urlopen(request_string)
data = conn.read()


你可能感兴趣的:(proxy,Authentication)