Diese Arbeit fein:Python urllib2> HTTP Proxy> HTTPS-Anfrage
import urllib2
opener = urllib2.build_opener(
urllib2.HTTPHandler(),
urllib2.HTTPSHandler(),
urllib2.ProxyHandler({'http': 'http://user:[email protected]:3128'}))
urllib2.install_opener(opener)
print urllib2.urlopen('http://www.google.com').read()
Aber wenn http Änderung https:
...
print urllib2.urlopen('https://www.google.com').read()
Es gibt Fehler:
Traceback (most recent call last):
File "D:\Temp\6\tmp.py", line 13, in <module>
print urllib2.urlopen('https://www.google.com').read()
File "C:\Python26\lib\urllib2.py", line 124, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python26\lib\urllib2.py", line 389, in open
response = self._open(req, data)
File "C:\Python26\lib\urllib2.py", line 407, in _open
'_open', req)
File "C:\Python26\lib\urllib2.py", line 367, in _call_chain
result = func(*args)
File "C:\Python26\lib\urllib2.py", line 1154, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "C:\Python26\lib\urllib2.py", line 1121, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 10060]
Warum und wie löst man dieses Problem?
wenn Sie dies lesen: Bitte markieren Sie die richtige Antwort als richtig. Dies soll sicherstellen, dass niemand seine Zeit verschwendet, um eine bereits beantwortete Frage zu beantworten. Es ist auch eine nette Art, sich bei der Person zu bedanken, die eine Lösung für Ihr Problem gefunden hat. – Sheena