gpt4 book ai didi

python - 使用PRAW拉取1000多个top条目

转载 作者:太空宇宙 更新时间:2023-11-04 01:07:13 25 4
gpt4 key购买 nike

我怎样才能得到 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.

关于python - 使用PRAW拉取1000多个top条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29756434/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com