千家信息网

python自动化测试---报错总结

发表于:2024-10-22 作者:千家信息网编辑
千家信息网最后更新 2024年10月22日,1. 运行程序时,报以下错误:HTTPSConnectionPool(host='test.xxxx.com', port=443): Max retries exceeded with url: /
千家信息网最后更新 2024年10月22日python自动化测试---报错总结

1. 运行程序时,报以下错误:

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)'),))

解决方法:requests请求时加上:verify=False


2. 不显示warning信息

import urllib3

# 去掉运行时的Warning

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


0