且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在没有系统配置代理的情况下使用请求库

更新时间:2022-06-19 21:20:44

事实证明,您必须对要使用直接连接的协议使用空字符串:

Turns out you have to use an empty string for the protocol you want to use a direct connection:

r = requests.get('http://google.com', proxies = { 'http': '', ... })

很奇怪,但这就是生活.

Weird, but that's life.