赞
踩
- import requests
-
- proxy = {
- "http": "http://127.0.0.1:8888",
- "https": "http://127.0.0.1:8888",
- }
-
-
- def test():
- requests.post("https://www.baidu.com", proxies=proxy)
刚开始的代码如上,会出现以下的报错:
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]
这是设置不认证就可以了,代码如下:
- import requests
-
- proxy = {
- "http": "http://127.0.0.1:8888",
- "https": "http://127.0.0.1:8888",
- }
-
-
- def test():
- requests.post("https://www.baidu.com", proxies=proxy, verify=False)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。