python 存储数据报错:
UnicodeEncodeError: 'gbk' codec can't encode character 'U0001f612' in position 95: illegal multibyte sequence
解决:open(filename+'.json','w') 部分添加encoding='utf-8'
filename=str(yesterday)
with open(filename+'.json','w',encoding='utf-8') as outfile:
for i in data:
json.dump(i,outfile,ensure_ascii=False)
outfile.write('
')