Q: SSLError: max retries exceeded with url error? How to fix this? I am attempting to scrape text off of websites, and I am using the requests module to do so.
With the given code (Facebook as an example here)
requests.get('http://facebook.com')

I receive back the following error:
SSLError: HTTPSConnectionPool(host='facebook.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

I have tried the following with no luck:
pip install certifi
pip install certifi_win32

Any help would be greatly appreciated! Thank you!

A: You can try this way
import requests
from urllib3.exceptions import InsecureRequestWarning
from urllib3 import disable_warnings

disable_warnings(InsecureRequestWarning)

page = requests.get('http://facebook.com', verify=False)

print(page.content)


A: The problem probably stems from an overly aggressive security measure that you might be able to fix in two steps:

*

*Download the raw CA Bundle from https://certifiio.readthedocs.io/en/latest/

*In requests.get use verify=[path to raw CA Bundle]

