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.

7
PRAW 403 Forbidden Response issue
Post Flair (click to view more posts with a particular flair)
Post Body

I have been using a PRAW Reddit script application instance to get comments and submissions from the movies and science subreddits. I supply my username and password too. I am able to to get them properly from the movies subreddit but not from the science subreddit. The following exception is generated in the science subreddit: prawcore.exceptions.Forbidden: received 403 HTTP response . However, this only happens for the science subreddit and not movies. My PRAW version is 7.7.0. I tried searching on the internet and tried changing my user agent, but that didn't help.

I checked this file: https://github.com/praw-dev/prawcore/blob/main/prawcore/exceptions.py which states that the Forbidden exception occurs when "authentication is not permitted for the request" but I don't understand how that can happen for science but not movies. Would really appreciate any help. Thanks! Traceback:

ERROR:root:In Block 2

Traceback (most recent call last):

File "/[secret]/Reddit_Data_Collect/science_crawler.py", line 105, in <module>

subm.comments.replace_more(limit=None)

File "/[secret]/.local/lib/python3.9/site-packages/praw/models/reddit/base.py", line 34, in __getattr__

self._fetch()

File "/[secret]/.local/lib/python3.9/site-packages/praw/models/reddit/submission.py", line 622, in _fetch

data = self._fetch_data()

File "/[secret]/.local/lib/python3.9/site-packages/praw/models/reddit/submission.py", line 640, in _fetch_data

return self._reddit.request(method="GET", params=params, path=path)

File "/[secret]/.local/lib/python3.9/site-packages/praw/util/deprecate_args.py", line 43, in wrapped

return func(**dict(zip(_old_args, args)), **kwargs)

File "/[secret]/.local/lib/python3.9/site-packages/praw/reddit.py", line 941, in request

return self._core.request(

File "/[secret]/.local/lib/python3.9/site-packages/prawcore/sessions.py", line 330, in request

return self._request_with_retries(

File "/[secret]/.local/lib/python3.9/site-packages/prawcore/sessions.py", line 266, in _request_with_retries

raise self.STATUS_EXCEPTIONS[response.status_code](response)

prawcore.exceptions.Forbidden: received 403 HTTP response

EDIT: Added traceback

Author
Account Strength
80%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
177
Link Karma
27
Comment Karma
150
Profile updated: 1 day 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