首页 > 解决方案 > 为 Reddit 提取所有可能的用户评论

问题描述

我正在尝试对特定的 reddit 链接进行情绪分析

url = 'https://www.reddit.com/r/LegendsOfRuneterra/comments/gqdwy2/patch_12_discussion_megathread/'
sub = reddit.submission(url = url)
comments = [comment.body for comment in sub.comments if hasattr(comment, "body")]  
print(comments)

1)代码有效,但评论看起来太少了。我想知道我是不是做错了什么?2) 似乎也有一个自然限制,比如 1000 条评论?如何提取所有数据?

标签: pythonsentiment-analysisreddit

解决方案


推荐阅读