gingeleski / odds-portal-scraper

Sports odds and results scraping for Odds Portal (oddsportal.com).
The Unlicense
104 stars 53 forks source link

No JSON object could be decoded #2

Closed EvaldasJ closed 5 years ago

EvaldasJ commented 6 years ago

Hi, thanks for a great resource. However, I'm having some difficulties with running the scraper. I get the following error. I've tried searching for what could be the problem, but nothing has worked so far.

(venv) 5072AB1C:odds-portal-scraper-master admin$ python /Users/admin/Desktop/odds-portal-scraper-master/run.py
Traceback (most recent call last):
  File "/Users/admin/Desktop/odds-portal-scraper-master/run.py", line 19, in <module>
    match_scraper = Scraper(json_str, initialize_db)
  File "/Users/admin/Desktop/odds-portal-scraper-master/Scraper.py", line 28, in __init__
    self.league = self.parse_json(league_json)
  File "/Users/admin/Desktop/odds-portal-scraper-master/Scraper.py", line 42, in parse_json
    return json.loads(json_str)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
(venv) 5072AB1C:odds-portal-scraper-master admin$ 
gingeleski commented 5 years ago

In looking at this again (a very long time later...), I believe this is a Python version issue.

The code in question was developed with Python 3.x and it seems reasonable there are JSON decoder differences since Python 2.x

I've added a note to the overall README for others' benefit.