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

如何增加转发者或评论者昵称? #2

Closed
biubiu3 opened this issue May 1, 2021 · 1 comment
Closed

如何增加转发者或评论者昵称? #2

biubiu3 opened this issue May 1, 2021 · 1 comment

Comments

@biubiu3
Copy link

biubiu3 commented May 1, 2021

现在有转发者或评论者id,请问如何修改,保存时可以增加转发者或评论者的昵称?

@XWang20
Copy link
Owner

XWang20 commented May 9, 2021

第一种方法是直接爬取用户信息,即运行scrapy crawl user,
第二种是修改代码,爬取某条微博的评论/转发时直接保存昵称。
以转发为例子

  1. repost.py中34行添加
repostItem['nick_name'] = repost['user']['screen_name']
  1. items.pyRepostItem类中添加
nick_name = Field()

@XWang20 XWang20 closed this as completed Apr 21, 2023
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

2 participants