Skip to content

[SSL: CERTIFICATE_VERIFY_FAILED] on pythonscraping  #106

Open

Description

@Ryan-Bringenberg

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)>

Activity

  1. JosephWhang commented on May 6, 2022

    @JosephWhang
  2. scarbear06 commented on Jun 21, 2022

    @scarbear06

    @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())

  3. JosephWhang commented on Jun 21, 2022

    @JosephWhang
  4. Xnac commented on Jun 24, 2022

    @Xnac

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

  5. gitchegumee11 commented on Apr 15, 2024

    @gitchegumee11

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions