UnicodeEncodeError: 'gbk' codec can't encode character '\xbb' in position 29802: illegal multibyte
上面这段代码会报:UnicodeEncodeError: 'gbk' codec can't encode character '\xbb' in position 29802: illegal multibyte sequence
错误的原因是with没有指定编码格式。指定为utf-8格式就好了。
with open('header.html', "w", encoding="ut...
原创
2019-07-15 17:31:58 ·
1530 阅读 ·
0 评论