解决python UnicodeEncodeError: 'gbk' codec can't encode character '\xbb' in

解决python  UnicodeEncodeError: 'gbk' codec can't encode character '\xbb' in

 

 打印结果:

UnicodeEncodeError: 'gbk' codec can't encode character '\xbb' in position 8530: illegal multibyte sequence

并且输出的html页面出现乱码,不能正常显示:

将上面的代码变换下顺序,如下

解决python  UnicodeEncodeError: 'gbk' codec can't encode character '\xbb' in

 

 输出结果为正常

 

上一篇:**pip安装三方库不成功:WARNING: You are using pip version 20.3.1; however, version 20.3.3 is available.**


下一篇:解决:UnicodeEncodeError: ‘gbk‘ codec can‘t encode character ‘\xa0‘ in position 707: illegal multibyte