其他分享
首页 > 其他分享> > 解决UnicodeEncodeError: 'ascii' codec can't encode characters in position

解决UnicodeEncodeError: 'ascii' codec can't encode characters in position

作者:互联网

为什么80%的码农都做不了架构师?>>>   hot3.png

解决UnicodeEncodeError: 'ascii' codec can't encode characters in position
最近用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

原文链接http://www.hankcs.com/program/python/asciicodec-cant-encode-characters-in-position-unicodeencodeerror.html

转载于:https://my.oschina.net/hankcs/blog/512097

标签:codec,UnicodeEncodeError,characters,encode,position,ascii
来源: https://blog.csdn.net/weixin_34007879/article/details/91780384