When I try to parse a web page, I get the following error:
Traceback (most recent call last): File "C:\Users\Butooz\Desktop\untitled\test.py", line 10, in <module> print(soup.findAll('a')) File "C:\Users\Butooz\AppData\Local\Programs\Python\Python35-32\lib\encodings\cp866.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_map)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\xab' in position 3987: character maps to <undefined> The script looks like this:
url = 'https://aheku.net/news/' html = urllib.request.urlopen(url) soup = BeautifulSoup(html, 'html5lib') print(soup.findAll('a')) How can this be fixed?