2013年4月30日

Python Crawler的JSON输出编码问题

摘要: 无论爬取时是否进行解码与编码,最终作如下处理便可解决乱码的问题:import codecsjson_output=json.dumps(text_content,ensure_ascii=False,indent=4)jsonfile = 'output.json'j =codecs.open(jsonfile,'w','utf-8')j.write(json_output)j.close() 阅读全文

posted @ 2013-04-30 16:51 0x9801 阅读(123) 评论(0) 推荐(0)

导航