最近用Python写了些爬虫,在爬取一个gb2312的页面时,抛出异常:UnicodeEncodeError: 'ascii' codec can't encode characters in position 21-23: ordinal not in range(128)解决方案如下:首先设置系统的默认编码为utf-8:import sys re...
继续阅读:码农场 » 解决UnicodeEncodeError: 'ascii' codec can't encode characters in position
转载于:https://my.oschina.net/hankcs/blog/512097