开发者

Use URLLIB without system default proxy Python

开发者 https://www.devze.com 2023-01-21 23:15 出处:网络
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

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

精彩评论

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

关注公众号