urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)

Learning to scrape a website. "https://www.localharvest.org/" for now. trying to urlopen but gives the above mentioned error. Windows 10 64-64 bit, Python 3.7.1

from urllib.request import urlopen
from bs4 import BeautifulSoup as soup

url = 'https://www.localharvest.org/'
response = urlopen(url)

Upvotes: 0

Views: 4765

Answers (2)

naam
naam

Reputation: 520

In Ubuntu 20.04, this helped me

sudo update-ca-certificates --fresh
export SSL_CERT_DIR=/etc/ssl/certs

Upvotes: 1

CarlosJHernandez
CarlosJHernandez

Reputation: 63

Via PIP - bash pip install --upgrade certifi

timon.web: Fixing CERTIFICATE_VERIFY_FAILED error

Upvotes: 0

Related Questions