Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SSL: CERTIFICATE_VERIFY_FAILED] on pythonscraping #106

Open
Ryan-Bringenberg opened this issue May 6, 2022 · 5 comments
Open

[SSL: CERTIFICATE_VERIFY_FAILED] on pythonscraping #106

Ryan-Bringenberg opened this issue May 6, 2022 · 5 comments

Comments

@Ryan-Bringenberg
Copy link

When running the code in the first two chapters that use pythonscraping.com I receive the following error:

<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1125)>

@JosephWhang
Copy link

JosephWhang commented May 6, 2022 via email

@scarbear06
Copy link

@Ryan-Bringenberg you need to use this code
import ssl
ssl._create_default_https_context = ssl._create_unverified_context

Example:

from urllib.request import urlopen
import ssl
ssl._create_default_https_context = ssl._create_unverified_context

html = urlopen('http://pythonscraping.com/pages/page1.html')
print(html.read())

@JosephWhang
Copy link

JosephWhang commented Jun 21, 2022 via email

@Xnac
Copy link

Xnac commented Jun 24, 2022

I update my system, in conda: conda update -n base -c defaults conda

@gitchegumee11
Copy link

@scarbear06 - Why is that not included in the book already? Or is there a way to update our system to have that automatically run with the script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants