python自動化測試---報錯總結

1. 運行程序時,報如下錯誤:html

HTTPSConnectionPool(host='test.xxxx.com', port=443): Max retries exceeded with url: /openapi/smartStock/000008.SZ.shtml (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)'),))api

解決方法:requests請求時加上:verify=Falseide

image.png


2. 不顯示warning信息url

import urllib3htm

# 去掉運行時的Warningblog

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)ssl

相關文章
相關標籤/搜索