Start a new topic
Answered

Requests in Python 2.7 - error 407

Does anybody knows why the code proposed on the site:  does not work in python 2.7? 


Every time you run this code I get 407 !!!! 

 

import requests

url = "http://httpbin.org/ip"
proxy_host = "proxy.crawlera.com"
proxy_port = "8010"
proxy_auth = "<APIKEY>:"
proxies = {"https": "https://{}@{}:{}/".format(proxy_auth, proxy_host, proxy_port),
      "http": "http://{}@{}:{}/".format(proxy_auth, proxy_host, proxy_port)}

r = requests.get(url, proxies=proxies,
                 verify=False, allow_redirects=False)

 

please help!


Best Answer
1 Comment

Login to post a comment