使用PRAW拉取1000多个top条目
Using PRAW to pull more than 1000 top entries
如何才能 praw
下载 reddit 子目录中超过 1000 个热门标题?以下最小工作示例在 1000 处停止:
import praw
subreddit_name = "todayilearned"
user_agent = "TopHITS v0.1"
agent = praw.Reddit(user_agent=user_agent)
sub = agent.get_subreddit(subreddit_name)
submissions = sub.get_top_from_all(limit=None)
for result in submissions:
print result
请注意 the documentation of praw
中的以下段落:
We can at most get 1000 results from every listing, this is an
upstream limitation by reddit. There is nothing we can do to go past
this limit. But we may be able to get the results we want with the
search() method instead.
如何才能 praw
下载 reddit 子目录中超过 1000 个热门标题?以下最小工作示例在 1000 处停止:
import praw
subreddit_name = "todayilearned"
user_agent = "TopHITS v0.1"
agent = praw.Reddit(user_agent=user_agent)
sub = agent.get_subreddit(subreddit_name)
submissions = sub.get_top_from_all(limit=None)
for result in submissions:
print result
请注意 the documentation of praw
中的以下段落:
We can at most get 1000 results from every listing, this is an upstream limitation by reddit. There is nothing we can do to go past this limit. But we may be able to get the results we want with the search() method instead.