标签:style blog http ar color sp for on div
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()
参考网址:http://www.decalage.info/en/python/urllib2noproxy
标签:style blog http ar color sp for on div
原文地址:http://www.cnblogs.com/summerwinter/p/4118039.html