因为想做一个爬虫定时领取淘宝的淘金币,无奈在使用requests获取页面内容时,收到了错误提示:/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:791: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:791: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
根据Google到的结果,解决方案如下:1.在使用requests前加入:requests.packages.urllib3.disable_warnings()
2.为requests添加verify=False参数,比如:r = requests.get('https://blog.bbzhh.com',verify=False)
如下是 urllib3 文档的说明
InsecurePlatformWarningNew in version 1.11.
<