Python Proxy-Fehler-Mit-Anfragen-Bibliothek

Ich versuche, Zugriff auf das web über einen proxy-server in Python. Ich bin mit den Anforderungen der Bibliothek und ich habe ein Problem mit der Authentifizierung von my-proxy als proxy benutze ich ein Kennwort erforderlich ist.

proxyDict = { 
          'http'  : 'username:[email protected]', 
          'https' : 'username:[email protected]'
        }
r = requests.get("http://www.google.com", proxies=proxyDict)

Ich erhalte die folgende Fehlermeldung:

Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
r = requests.get("http://www.google.com", proxies=proxyDict)
File "C:\Python27\lib\site-packages\requests\api.py", line 78, in get
:param url: URL for the new :class:`Request` object.
File "C:\Python27\lib\site-packages\requests\api.py", line 65, in request
"""Sends a POST request. Returns :class:`Response` object.
File "C:\Python27\lib\site-packages\requests\sessions.py", line 187, in request
def head(self, url, **kwargs):
File "C:\Python27\lib\site-packages\requests\models.py", line 407, in send
"""
File "C:\Python27\lib\site-packages\requests\packages\urllib3\poolmanager.py", line     127, in proxy_from_url
File "C:\Python27\lib\site-packages\requests\packages\urllib3\connectionpool.py", line    521, in connection_from_url
File "C:\Python27\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 497, in get_host
ValueError: invalid literal for int() with base 10: '[email protected]'

Wie löse ich dieses?

Dank im Voraus für Eure Hilfe.

Es ist gute Manieren, um markieren Sie die richtige Antworten als richtig

InformationsquelleAutor Mark Collier | 2012-01-14

Schreibe einen Kommentar