我试图从存档的网络爬虫中打印一个字符串,但是当我这样做时,我会得到以下错误:
print page['html']
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position 17710: ordinal not in range(128)
当我尝试打印
unicode(page['html'])
时,我得到:print unicode(page['html'],errors='ignore')
TypeError: decoding Unicode is not supported
有任何想法如何正确编码这个字符串,或者至少让它打印出来吗?谢谢。