I am using Python 3.4 on Mac OSX. When trying to web scrape, I am getting this error. I have searched links for this error but couldn't find any proper response for Python 3.4 on Mac OSX. Can someone suggest me how to solve this error?Below is the code that I am trying.
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen("http://en.wikipedia.org/wiki/Kevin_Bacon")
bsObj = BeautifulSoup(html, "html.parser")
for links in bsObj.findAll("a"):
if 'href' in links.attrs:
print (links.attrs['href'])