Fix Python – Scraping: SSL: CERTIFICATE_VERIFY_FAILED error for http://en.wikipedia.org

I’m practicing the code from ‘Web Scraping with Python’, and I keep having this certificate problem:
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(….

Fix Python – urllib and “SSL: CERTIFICATE_VERIFY_FAILED” Error

I am getting the following error:
Exception in thread Thread-3:
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py”, line 810, in __bootstrap_inner
self.run()
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py”, line 763, in run
self.__target….