from urllib.request import urlopen
from bs4 import BeautifulSoup
content = urlopen("http://en.wikipedia.org/wiki/List_of_human_stampedes")
soup = BeautifulSoup(content)
print(soup.get_text())
print(soup.prettify())
error:
Traceback (most recent call last):
File "C:\Users\sony\Desktop\Trash\Crawler Try\try3.py", line 5, in <module>
print(soup.get_text())
File "C:\Python34\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u014d' in position 10487: character maps to <undefined>
[Finished in 2.1s with exit code 1]
Seems to be page specific for eg. I get this in case replacing url by http://www.quora.com