UnicodeEncodeError: ‘gbk‘ codec can‘t encode character ‘\xa9‘ in position 6870: illegal multibyte s

UnicodeEncodeError: ‘gbk’ codec can’t encode character ‘\xa9’ in position 6870: illegal multibyte sequence

解决方案 open()方法添加 encoding=“utf-8”,示例如下

with open('test.html', 'w', encoding='utf-8') as f:
    f.write(r.text)
上一篇:ShareKit


下一篇:iphone-Cocos2D游戏开发