Get all comments from a specific reddit thread in python

后端 未结 3 1034
难免孤独
难免孤独 2021-02-05 11:40

The official way,

r = praw.Reddit(\'Comment Scraper 1.0 by u/_Daimon_ see \'
                 \'https://praw.readthedocs.org/en/latest/\'
                 \'page         


        
3条回答
  •  广开言路
    2021-02-05 11:51

    Looks like praw has been updated? In 4.5.1 it looks more like:

    #!/usr/local/bin/python
    import praw
    
    reddit = praw.Reddit(
        client_id='',
        client_secret='',
        user_agent='davehodg/0.1')
    
    submission = reddit.submission(id='')
    
    for comment in submission.comments.list():
        print(comment.body)
    

    Edit: seems like the most I can get back is 1000 comments?

提交回复
热议问题