1. 指定域名不使用代理
import os import requests os.environ['NO_PROXY'] = 'stackoverflow.com' response = requests.get('http://www.stackoverflow.com')
2. 设置代理为None
import requests proxies = { "http": None, "https": None, } requests.get("http://example.org", proxies=proxies)
3. 设置trust_env = False
import requests session = requests.Session() session.trust_env = False response = session.get('http://www.stackoverflow.com')
标签:None,http,get,系统,代理,session,import,requests From: https://www.cnblogs.com/hushaojun/p/17328297.html