title: Scraping: SSL: CERTIFICATE_VERIFY_FAILED error for http://en.wikipedia.org
body: <p>I'm practicing the code from 'Web Scraping with Python', and I keep having this certificate problem:</p>
  
  <pre><code>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("")
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>  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: &lt;urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1049)&gt;
  </code></pre>
  
  <p>Btw,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)</p>