Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

网易新闻爬取项目输出的txt文档出现乱码 #7

Open
latioas opened this issue Jan 23, 2019 · 0 comments
Open

网易新闻爬取项目输出的txt文档出现乱码 #7

latioas opened this issue Jan 23, 2019 · 0 comments

Comments

@latioas
Copy link

latioas commented Jan 23, 2019

网易新闻爬取项目输出的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]))    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant