如何获取 redditor 列表发布的所有提交和评论?
How to get ALL submissions and comments posted by a list of redditors?
我需要获取在 Reddit 上发布的所有提交和评论,以获得用户名列表。我在 PRAW
:
中创建了一个 redditor 实例
import praw
reddit = praw.Reddit(client_id='client_id',
client_secret='client_secret',
user_agent='Crawling (by /u/username)',
username='username',
password='password')
redditor = reddit.redditor('username1')
所以我可以通过这行代码获取新的提交:
redditor.submissions.new()
但我想知道如何获得用户名的所有提交和评论?
为了从用户那里获得更多提交,请更改 new
方法的 limit
属性。默认情况下,我认为 limit
的值是 25,但您可以使用此行提高限制。
redditor.submissions.new(limit=1000) #you can use any number in place of 1000
我需要获取在 Reddit 上发布的所有提交和评论,以获得用户名列表。我在 PRAW
:
import praw
reddit = praw.Reddit(client_id='client_id',
client_secret='client_secret',
user_agent='Crawling (by /u/username)',
username='username',
password='password')
redditor = reddit.redditor('username1')
所以我可以通过这行代码获取新的提交:
redditor.submissions.new()
但我想知道如何获得用户名的所有提交和评论?
为了从用户那里获得更多提交,请更改 new
方法的 limit
属性。默认情况下,我认为 limit
的值是 25,但您可以使用此行提高限制。
redditor.submissions.new(limit=1000) #you can use any number in place of 1000