Hey,
hab mir einen kleinen link-klicker gebaut, funktioneirt alles super, außer dass bei meienr Proxyliste manchmal Proxies kommen, die ein Passwort wollen, damit man auf sie zugreifen darf. Nun würde ich diese gerne einfach überspringen, aber ich weiß nicht wie ich die passwortmeldung abfangen kann. Verbinden tue ich über urllib.urlopen. Kann mir jemand helfen?
thx schonmal
gruß
Proxy
Wenn ich dich richtig verstanden habe, dann sollte folgender Link dir helfen?
http://stackoverflow.com/questions/2380 ... n-requests
Auszug:
The code attribute of the exception can be used to verify that authentication is required - code 401.
Ansonsten bitte noch mal das eigentliche Problem verdeutlichen, dann habe ich es schlichtweg nicht verstanden.
Grüße
Stefan
p.s.: 3. Google Treffer mit "urllib.urlopen authentication"
http://stackoverflow.com/questions/2380 ... n-requests
Auszug:
The code attribute of the exception can be used to verify that authentication is required - code 401.
Code: Alles auswählen
>>> try:
... conn = urllib2.urlopen('http://www.example.com/admin')
... # read conn and process data
... except urllib2.HTTPError, x:
... print 'Ignoring', x.code
...
Ignoring 401
>>>
Grüße
Stefan
p.s.: 3. Google Treffer mit "urllib.urlopen authentication"