1. 運(yùn)行程序時(shí),報(bào)以下錯(cuò)誤:

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請求時(shí)加上:verify=False

python自動(dòng)化測試---報(bào)錯(cuò)總結(jié)_第1張圖片


2. 不顯示warning信息

import urllib3

# 去掉運(yùn)行時(shí)的Warning

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)