1、How to force urllib2 not to use a proxy
Here is an example to remove proxy settings for all requests:
proxy_handler = urllib2.ProxyHandler({}) opener = urllib2.build_opener(proxy_handler) urllib2.install_opener(opener)
And here is an example for only one request:
proxy_handler = urllib2.ProxyHandler({}) opener = urllib2.build_opener(proxy_handler) req = urllib2.Request('http://...') r = opener.open(req) result = r.read()