Scraping Reddit Data Using PRAW (Python)
Get comments from a specific post
You can get the comments for a post/submission by creating/obtaining a Submission object and looping through the comments attribute. This will work for some submission, but for others that have more comments this code will throw an AttributeError saying:
AttributeError: ‘MoreComments’ object has no attribute ‘body’These MoreComments object represent the “load more comments” and “continue this thread” links encountered on the websites, as described in more detail in the comment documentation. The above code will first of output all the top-level comments, followed by the second-level comments and so on until there are no comments left.
Source: towardsdatascience.com