cbyoda
cbyoda

Reputation: 87

SSLError: HTTPSConnectionPool

I am trying to do some web scraping of movie reviews from IMDB through the following code:

import requests
from time import sleep
url='https://www.imdb.com/title/tt0068646/reviews?ref_=tt_urv'
response= requests.get(url)

and am getting this error :

SSLError: HTTPSConnectionPool(host='www.imdb.com', port=443): Max retries exceeded with url: /title/tt0068646/reviews?ref_=tt_urv (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

Any thoughts?

Upvotes: 5

Views: 9658

Answers (2)

kalng
kalng

Reputation: 1

You can try restarting the network or computer。This may work。

Upvotes: -1

Amir Afianian
Amir Afianian

Reputation: 2785

You get this error because certification validation has failed (which is odd given that you are opening IMDB). You can turn off certification validation by setting the verify parameter to false:

r = requests.get(url, verify=False)

As for why certificate validation is failing, I guess, it's because the date and time on your machine are not correctly set.

Upvotes: 3

Related Questions