I'm just wondering if there's a simple enough way to iterate over all comments made by a particular user (I want to check for a particular phrase). Any help is appreciated :)
You can't get all comments, if the user has more than 1,000 comments. It is a limitation of the reddit API. However, the code below will get (and print the body) of all comments made by a user.
import praw
r = praw.Reddit('Your unique user agent')
user = r.get_redditor('REDDITOR-USER-HANDLE')
for comment in user.get_comments(limit=None):
print comment.body
A coupe notes:
REDDITOR-USER-HANDLE
is the user name of the user you are looking atIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With