When you send HTTPS requests using Requests

 requests.get(url, parmas=parmas, headers=header, cookies=cookie) 

The following error has occurred

HTTPSConnectionPool(host='www.imooc.com', port=443): Max retries exceeded with url: /api3/getbanneradvertver2 (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)'),))
Copy the code

 

A reason for

When you send an HTTPS request, SSL validation is required, and the Verify parameter to the Requests request method defaults to True, indicating validation

 

How to solve it?

Turn off validation as follows

requests.get(url, parmas=parmas, headers=header, cookies=cookie, verify=False)