** 解决UnicodeEncodeError: ‘gbk’ codec can’t encode character ‘\u2022’ in position问题 ** 有时候把爬网站内容并写入文件的时候,会碰到 打开文件的时候价格编码这样就行 with open(‘test.html’, ‘w’, encoding=‘utf-8’)as f: f.write(data)