json.decoder.JSONDecodeError: Expecting value
See original GitHub issueHi @agentphantom ,
This is me again, sorry. I have another issue with the script. I’m trying to download the submissions from r/goodanimemes from the last 2 weeks.
But after some time I get this error message :
Traceback (most recent call last): File "subreddit_submissions_alt.py", line 115, in <module> init() File "subreddit_submissions_alt.py", line 40, in init download_submissions(subreddit=subreddit) File "subreddit_submissions_alt.py", line 110, in download_submissions download_submissions(subreddit, latest_timestamp) File "subreddit_submissions_alt.py", line 110, in download_submissions download_submissions(subreddit, latest_timestamp) File "subreddit_submissions_alt.py", line 110, in download_submissions download_submissions(subreddit, latest_timestamp) [Previous line repeated 80 more times] File "subreddit_submissions_alt.py", line 72, in download_submissions json_data = response.json() File "C:\Python38\lib\site-packages\requests\models.py", line 898, in json return complexjson.loads(self.text, **kwargs) File "C:\Python38\lib\json\__init__.py", line 357, in loads return _default_decoder.decode(s) File "C:\Python38\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Python38\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
So I tried to launch the script again and I get the same error message but this line [Previous line repeated 80 more times] changed to [Previous line repeated 24 more times] (it’s a random number everytime).
I’m no JS programmer but my wild guess is that at some point, response.json() does not receive the right parameters, program does not know how to handle it and it causes it to stop.
Do you have any fix for this ? Thank you !
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)

Top Related StackOverflow Question
It works !!! Yes 😄 Also, I noticed generate_most_common_entities_word_cloud does not remove lines containing links so the datagram is filled with “https” “reddit” “jpg” etc. I found we can remove those text with :
df = df[~df["text"].str.contains('http')]in case you’re interested 😃Thank you for your patience and help ❤️ I wish you a good day !
The clouds can use any custom font but I didn’t include it in the repo as I don’t have the license. You have 2 opions: