Fix Python – Scraping: SSL: CERTIFICATE_VERIFY_FAILED error for

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(“”+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/”, line 810, in __bootstrap_inner
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/”, line 763, in run