The Submission.replace_more_comments
return a list of the MoreComment
objects that were NOT replaced. So if you're calling it with limit=None
and threshold=0
then it will return an empty list. See the replace_more_comments
docstring. Here's a full example of how to use both replace_more_comments
and flatten_tree
. For more information see the comment parsing page in our documentation.
import praw
r = praw.Reddit(UNIQUE_AND_DESCRIPTIVE_USERAGENT_CONTAINING_YOUR_REDDIT_USERNAME)
subreddit = r.get_subreddit('python')
submissions = subreddit.get_top(limit=1)
for submission in submissions:
submission.replace_more_comments(limit=None, threshold=0)
flat_comments = praw.helpers.flatten_tree(submission.comments)
for comment in flat_comments:
print(comment.body)