Requests.exceptions.SSLError:HTTPSConnectionPool (host=' www.baidu.com ', port=443): Max retries exceeded with URL:/(Caused by Sslerror (Sslerror (1, u' [ssl:certificate_verify_failed] CERTIFICATE VERIFY FAILED (_ssl.c:581) '),))
the error message is the above. First I looked for a lot of information, there are many people said to turn off certificate authentication (verify=False)) can solve this problem or when you do get, specify the SSL certificate. Response = Requests.get (' http://www.baidu.com/', headers = header, verify=False)
but I have not solved this problem perfectly with either of these methods, and there are some subsequent errors such as Insecurerequestwarning
Reference documentation for correct practice
Https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl
Reference Blog: http://blog.csdn.net/zahuopuboss/article/details/52964809
Just install a few requests dependency packages to fix this problem
Pip Install cryptography
Pip Install Pyopenssl
Pip Install Certifi
Go to Blog: 79013199
Python uses requests times wrong requests.exceptions.SSLError:HTTPSConnectionPool