Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

429
Views
Raspado: SSL: CERTIFICATE_VERIFY_FAILED error para http://en.wikipedia.org

Estoy practicando el código de 'Web Scraping with Python' y sigo teniendo este problema con el certificado:

 from urllib.request import urlopen from bs4 import BeautifulSoup import re pages = set() def getLinks(pageUrl): global pages html = urlopen("http://en.wikipedia.org"+pageUrl) bsObj = BeautifulSoup(html) for link in bsObj.findAll("a", href=re.compile("^(/wiki/)")): if 'href' in link.attrs: if link.attrs['href'] not in pages: #We have encountered a new page newPage = link.attrs['href'] print(newPage) pages.add(newPage) getLinks(newPage) getLinks("")

el error es:

 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1319, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1049)>

Por cierto, también estaba practicando scrapy, pero seguía teniendo el problema: command not found: scrapy (probé todo tipo de soluciones en línea pero ninguna funciona... realmente frustrante)

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Una vez me tropecé con este problema. Si usa macOS, vaya a Macintosh HD > Aplicaciones > carpeta Python3.6 (o cualquier versión de python que esté usando) > haga doble clic en el archivo "Instalar Certificates.command". :D

over 4 years ago · Santiago Trujillo Report

0

para usar SSL no verificado, puede agregar esto a su código:

 import ssl ssl._create_default_https_context = ssl._create_unverified_context
over 4 years ago · Santiago Trujillo Report

0

Este comando de terminal:

open /Applications/Python\ 3.7/Install\ Certificates.command

Encontrado aquí: https://stackoverflow.com/a/57614113/6207266

Me lo resolvió. Con mi configuración

pip install --upgrade certifi

no tuvo impacto.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!