python使用requests库请求网址时,发生requests.exceptions.SSLError 错误解决办法

解决办法1

1.降低requests版本

解决办法2

当指定headers的User-Agent时,baidu的服务器会重定向到https的网址.因此报出SSL验证失败的错误.
在进行GET时,指定SSL证书.详情见附件
关闭证书验证. 详情见附件

附件
[各浏览器的User-Agent] http://www.useragentstring.com/pages/useragentstring.php

[SSL 证书验证] https://requests.readthedocs.io/zh_CN/latest/user/advanced.html#ssl

原文地址:https://www.cnblogs.com/gqv2009/p/14303365.html