开发者

Use URLLIB without system default proxy Python

I have a small script that needs to communicate with me, it is part of my proxy. The script needs to run before the proxy starts, but the system is set to use the proxy, so it doe开发者_如何学Gos not go through. How would I use urllib, but not the default proxy?


urllib docs:

urllib.urlopen(url[, data[, proxies]])

[...] Alternatively, the optional proxies argument may be used to explicitly specify proxies. It must be a dictionary mapping scheme names to proxy URLs, where an empty dictionary causes no proxies to be used, and None (the default value) causes environmental proxy settings to be used as discussed above. [...]

So just use proxies={}.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜