1. 遇到這種錯誤有多是機器無外網權限形成的。this
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /s/savecomtajax (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f972f48bf90>: Failed to establish a new connection: [Errno 110] Connection timed out',))url
2. requests 發https 請求時,須要忽略證書的驗證, 須要注意以下點。spa
requests.packages.urllib3.disable_warnings() def request_ajax_url(login_url,login_body, headers): '''發送post請求數據''' req = requests.post(login_url, data=login_body, headers=headers, verify=False); return req.text