Python final project - webscraper project



I’m having some trouble with my python final project. I’m trying to create a webscraper, at first, and I keep getting the following error when running the program through windows cmd: " return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: ‘charmap’ codec can’t encode character ‘\u2019’ in position 947: character maps to "

Here is the link to the code:

Can you please help with a fix for this?


what python version are you using for the project?


Python 3.5.2 |Anaconda 4.2.0 (64-bit)


i ran your code, and i didn’t run into any issues, it perfectly output what it needs to:

I think you need to google this or ask the bs4 community


I have googled it. I will try the bs4 community as well. Thanks.


and using encoding to enforce utf8 didn’t work:


I checked the fixes from the thread and ‘soup = BeautifulSoup(html_doc, ‘html.parser’).encode(“ascii”)’ actually worked. Thanks a lot for the help!