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

为什么80%的码农都做不了架构师?>>>   解决UnicodeEncodeError: 'ascii' codec can't encode characters in position

解决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

上一篇:接口测试中读取excel中的请求数据含有中文问题,UnicodeEncodeError: 'latin-1' codec can't encode character &


下一篇:python发起请求提示UnicodeEncodeError