1.在爬虫时出现报错:
requests.exceptions.SSLError: HTTPSConnectionPool(host=‘heat.qq.com’, port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(“bad handshake: SysCallError(10054, ‘WSAECONNRESET’)”)))
2.解决方法
第一步:在request.get()\requet.post()里面加参数:verify=False;
目的是:移除SSL认证
移除后会出现警告:
InsecureRequestWarning: Unverified HTTPS request is being made to host ‘xxxxxxxx’. Adding certificate verification is strongly advised.
第二步:
import urllib3
from urllib3.exceptions import InsecureRequestWarning
urllib3.disable_warnings(InsecureRequestWarning)
成功解决!