PythonSpiderNotes
PythonSpiderNotes copied to clipboard
网易新闻爬取项目输出的txt文档出现乱码
网易新闻爬取项目输出的txt文档出现乱码, 当15,16行做出如下修改后,输出的txt文档正常了。
with open(path, "w+") as fp:
for s in slist:
print(s[0], s[1])
fp.write("%s\t\t%s\n\n" %(s[0],s[1]))