pycharm用requests爬虫时报错requests.exceptions.SSLError: HTTPSConnectionPool

img


爬虫报错,网上方法全试过了,都不行,包括跳过验证啊什么的!
自己琢磨了几天时间发现要把项目删除pycharm卸载重新安装,然后更新pip再下载requests模块才能运行成功!
但是过几个小时就又会变成这样!

下面的有试过吗?

import urllib3
urllib3.disable_warnings() #这个添加在 requests.get('http://xxx.com/', headers = header, verify=False)上面一行

https://blog.csdn.net/ywj_486/article/details/106479003

用ssl库绕过验证试试:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
参考:
https://www.jianshu.com/p/4f83021de242

已经解决了,刚刚发现的,这个电脑的代理老是自己打开,关掉就没事了!

加个verify=False