Einstellung proxy urlib.Anfrage (Python ist3)

Wie kann ich einen proxy für die letzten urllib in Python 3.
Ich mache die nächsten

from urllib import request as urlrequest
ask = urlrequest.Request(url)     # note that here Request has R not r as prev versions
open = urlrequest.urlopen(req)
open.read()

Habe ich versucht, indem proxy wie folgt :

ask=urlrequest.Request.set_proxy(ask,proxies,'http')

Allerdings weiß ich nicht, wie richtig es ist, da bin ich immer der nächste Fehler:

336     def set_proxy(self, host, type):
--> 337         if self.type == 'https' and not self._tunnel_host:
    338             self._tunnel_host = self.host
    339         else:

AttributeError: 'NoneType' object has no attribute 'type'

InformationsquelleAutor gm1 | 2016-01-03

Schreibe einen Kommentar