Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Error #1

Open
dc500 opened this issue Jun 11, 2018 · 1 comment
Open

JSON Error #1

dc500 opened this issue Jun 11, 2018 · 1 comment

Comments

@dc500
Copy link

dc500 commented Jun 11, 2018

I figured out the issue with the pip install pattern and I manually updated all the code from python 2 to python 3. Now my headache is:

$ python price_check.py 08/30/2018 09/30/2018 BWI ICN DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.expedia.com DEBUG:urllib3.connectionpool:https://www.expedia.com:443 "GET /Flights-Search?trip=roundtrip&leg1=from:BWI,to:ICN,departure:8/29/2018TANYT&leg2=from:ICN,to:BWI,departure:9/29/2018TANYT&passengers=adults:1,children:0,seniors:0,infantinlap:Y&options=cabinclass%3Aeconomy&mode=search&origref=www.expedia.com HTTP/1.1" 200 None DEBUG:root:Cannot find arrival request ID! DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.expedia.com DEBUG:urllib3.connectionpool:https://www.expedia.com:443 "GET /Flight-Search-Paging?c=7da0cad3-45dc-4098-8a03-1d814b696b52&is=1&fl0=&sp=asc&cz=200&cn=0&ul=1 HTTP/1.1" 200 4097 Traceback (most recent call last): File "price_check.py", line 108, in <module> flight_info_list.extend(scraper.get_flight_data_JSON()) File "/Users/admin/find-cheapest-flights/expedia_scraper.py", line 111, in get_flight_data_JSON data_dict = json.loads(e.content) File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/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)

How do I fix this?

@JiahongXue
Copy link

JiahongXue commented Mar 19, 2019

Hello, I was playing around with this code just now. And I got the same error. This error simply means there is nothing fed into the JSONDecoder. So I checked for possible solutions and find out this API were actually retired on April 10, 2018, according to this page: https://developers.google.com/qpx-express/. So the API was not responding with anything which causes this error. We will probably have to look for an alternative API. I am trying to see if skyscanner API. Not sure if this would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants