【Python3】requests设置代理

指导文档:
http://docs.python-requests.org/en/master/user/advanced/#proxies 的Proxies
http://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification 的SSL Cert Verification

1、requests设置代理

import requests
proxies = {'http': 'http://localhost:8888', 'https': 'http://localhost:8888'}
url = 'http://www.baidu.com'
requests.post(url, proxies=proxies, verify=False) #verify是否验证服务器的SSL证书

执行结果:
【Python3】requests设置代理_第1张图片

相关资源:

http://www.dcsdn.com/doc/do-3728
http://www.dcsdn.com/doc/do-3662
http://www.dcsdn.com/doc/d-3573

原文链接:https://blog.csdn.net/weixin_38208401/article/details/80309432

你可能感兴趣的:(https,http,ssl)