Форум сайта python.su
Всем здравствуйте. Есть такой код:
import urllib.request as ur from bs4 import BeautifulSoup req = ur.Request('http://rghost.ru/search?s=.jpg') data = ur.urlopen(req) html = data.read().decode('utf8', 'replace') soup = BeautifulSoup(html) print(soup.prettify())
Traceback (most recent call last): File "C:\Python32\MYPROJ\django\fotoagregate\testing.py", line 11, in <module> print(soup.prettify()) File "C:\Python32\lib\encodings\cp1251.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u2713' in position 3043: character maps to <undefined> [Finished in 1.6s with exit code 1]
Отредактировано wiygn (Май 27, 2013 08:07:09)
Офлайн