Exception: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
See original GitHub issueI have been using icrawler
to scrap some images from Google Search. I have used this code,
from icrawler.builtin import GoogleImageCrawler
keyword = 'elon_musk'
num_images = 200
output_directory = 'dataset/images'
google_crawler = GoogleImageCrawler(storage={ 'root_dir': output_directory})
google_crawler.crawl(keyword=keyword, max_num=num_images , filters=None )
The execution ends with this exception,
Exception in thread parser-001:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.6/dist-packages/icrawler/parser.py", line 104, in worker_exec
for task in self.parse(response, **kwargs):
File "/usr/local/lib/python3.6/dist-packages/icrawler/builtin/google.py", line 157, in parse
meta = json.loads(txt)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I am using icrawler
in Google Colab hence with Python version 3.6.9 on Google Chrome browser.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Your code produced an empty response body, you'd want to check for that or catch the exception raised. It is possible the server...
Read more >JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The Python json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) occurs when we try to parse something that is not valid JSON...
Read more >Expecting Value: Line 1 column 1 (char 0) - Python Pool
JSONDecodeError means there is an incorrect JSON format being followed. For instance, the JSON data may be missing a curly bracket, have a...
Read more >JSONDecodeError Expecting value line 1 column 1 char 0
I am facing an error when decoding JSON. Expecting value: line 1 column 1 (char 0) The ... a curl request. Can someone...
Read more >json.decoder.jsondecodeerror: expecting value: line 1 column ...
The Python json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) occurs when we try to parse something that is not valid JSON...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have proposed a fix in PR #74
Can confirm this PR fixes the issue for me.