爬虫内容为列表,所以改进为: # coding:UTF-8 a =[u"编码问题1",u"编码问题2",u"编码问题3"] with open("1.txt","w") as f: for i in a: test2 = i.encode('UTF-8') f.write(test2) f.close from:https:// ... (more...)