Python在使用requests访问HTTPS网站时,如果关闭了证书验证,就得输出一句警告日志:
C:\Python27\lib\site-packages\urllib3\connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)
禁用警告日志输出很简单,加入这一句代码就可以了:
import requests requests.packages.urllib3.disable_warnings()
一般情况下:
关闭输出警告日志:
关键字词:
相关文章
- python 经常报错'module' object has no attribute 'X509_up_ref'
- python安装cv2 无法安装
- Python来识别字符串所属语言类型(langid 、langdetect)
- Python3 字典的复制与修改
- Python3 print 不换行打印教程
- Python3 bytes to string 字节码转字符串
- Scrapy Proxy Python下爬虫使用代理
- Scrapy 爬虫入门 内建设置参考 Python爬虫教程实战
- Scrapy 爬虫入门 Items 与 Item Pipeline Python爬虫教程实战
- Scrapy 爬虫入门 Spider 与 Selectors (选择器) Python爬虫教程实战