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.
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.
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/redditdev/c...