Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
Submission has no attribute 'comments'
Post Flair (click to view more posts with a particular flair)
Post Body

I'd like to fetch comments from a particular submission.\ It says submission has no comments,\ although num_comments is positive.\ Code below :

``` 14:59:05 ~/CODE/GITHUB/photoshopbattles-screensaver -2- $ ipython3 Python 3.5.3 (default, Nov 4 2021, 15:29:10) Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details.

In [1]: import praw

In [2]: submissions=praw.Reddit(user_agent="interactive test from ipython").get_content("https://www.reddit.com/r/photoshopbattles")

In [3]: subs = [sub for sub in submissions]

In [4]: sub0=subs[0]

In [5]: sub0.num_comments Out[5]: 8

In [6]: sub0.comments

AttributeError Traceback (most recent call last) <ipython-input-6-c26019482573> in <module>() ----> 1 sub0.comments

/usr/lib/python3/dist-packages/praw/objects.py in getattr(self, attr) 82 return getattr(self, attr) 83 raise AttributeError('\'%s\' has no attribute \'%s\'' % (type(self), ---> 84 attr)) 85 86 def getstate(self):

AttributeError: '<class 'praw.objects.Submission'>' has no attribute 'comments'

In [7]: ```

Note: sub0.comments was gladly auto-completed by ipython3.

Author
Account Strength
100%
Account Age
16 years
Verified Email
Yes
Verified Flair
No
Total Karma
21,388
Link Karma
19,732
Comment Karma
1,462
Profile updated: 2 days ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago