{"id":1074,"hash":"06440c2a1b6645dbed6aa48fcb8dda1c455ed12bd00108118d3c8dcb2fec288a","pattern":"Scraping: SSL: CERTIFICATE_VERIFY_FAILED error for http://en.wikipedia.org","full_message":"I'm practicing the code from 'Web Scraping with Python', and I keep having this certificate problem:\n\nfrom urllib.request import urlopen \nfrom bs4 import BeautifulSoup \nimport re\n\npages = set()\ndef getLinks(pageUrl):\n    global pages\n    html = urlopen(\"http://en.wikipedia.org\"+pageUrl)\n    bsObj = BeautifulSoup(html)\n    for link in bsObj.findAll(\"a\", href=re.compile(\"^(/wiki/)\")):\n        if 'href' in link.attrs:\n            if link.attrs['href'] not in pages:\n                #We have encountered a new page\n                newPage = link.attrs['href'] \n                print(newPage) \n                pages.add(newPage) \n                getLinks(newPage)\ngetLinks(\"\")\n\nThe error is:\n\n  File \"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 1319, in do_open\n    raise URLError(err)\nurllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1049)>\n\nBtw,I was also practicing scrapy, but kept getting the problem: command not found: scrapy (I tried all sorts of solutions online but none works... really frustrating)","ecosystem":"pypi","package_name":"web-scraping","package_version":null,"solution":"Once upon a time I stumbled  with this issue. If you're using macOS go to Macintosh HD > Applications > Python3.6 folder (or whatever version of python you're using) > double click on \"Install Certificates.command\" file. :D","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/50236117/scraping-ssl-certificate-verify-failed-error-for-http-en-wikipedia-org","votes":319,"created_at":"2026-04-19T04:52:18.510051+00:00","updated_at":"2026-04-19T04:52:18.510051+00:00"}