title: Getting child-comments of a comment on Reddit with Praw in Python
body: <p>I'm using praw to scrape information from a reddit thread. I can use <code>r.get_submission(thread).comments</code> to give me all the comments in a thread, but now I want to iterate through all of those comments and get the child comments.</p>
  
  <p>Here's what I have:</p>
  
  <pre><code>r = praw.Reddit(user_agent="archiver v 1.0")
  thread = "https://www.reddit.com/r/AskReddit/comments/4h4o7s/what_do_you_regret_doing_at_university/"
  r.login(settings['username'], settings['password'], disable_warning=True)
  submission = r.get_submission(thread)
  
  for comment in submission.comments:
      #this works, prints out the comments text
      print(comment.body)
  
      #now i want to get the child comments that are replied to this comment
      commentSubmission = r.get_submission(comment.permalink)
      #ideally comments[0] should show me first reply, comments[1] the second. etc
      print(commentSubmission.comments[1])
  </code></pre>
  
  <p>This throws <code>IndexError: list index out of range</code>. I'm using the method of trying to  get the comment as a submission because it's similiar to a solution I saw here when I was researching <a href="https://www.reddit.com/r/redditdev/comments/1kxd1n/how_can_i_get_the_replies_to_a_comment_with_praw/" rel="nofollow">https://www.reddit.com/r/redditdev/comments/1kxd1n/how_can_i_get_the_replies_to_a_comment_with_praw/</a></p>
  
  <p>My question is: Given a praw <code>comment</code> object, how can I loop through all the child comments that are replies? I want to get all the comments that are direct replies to another comment object.</p>
  
  <p>For example, in the example thread in my program, the first comment is <code>Not going out freshman year</code>I want to get the response comments like <code>Meh, I never went out at all in college.</code> and <code>Your story sounds identical to mine</code></p>