I am trying to connect to urls from python. I tried: urllib2, urlib3 and queries. This is the same problem that I encounter in all cases. As soon as I get the answer, I think that all three will work fine.
The problem is with the proxy server. I entered our proxy information, but I do not get any joy. I get 407 codes and error messages, such as: HTTP Error 407: Proxy Authentication Required (Forefront TMG requires authorization to complete the request. Access to the web proxy filter is denied.)
However, I can connect using another application that passes through a proxy server, such as git. When I run git config --get htpp.proxy , it returns the same values ββand format that I enter in Python, namely
http://username: password@proxy :8080
Example code in queries
import requests proxy = {"http": "http://username: password@proxy :8080"} url = 'http://example.org' r = requests.get(url, proxies=proxy) print r.status_code
thank you for your time
source share