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

raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1) when trying to get economic calendar. #605

Open
Turum opened this issue Sep 19, 2022 · 2 comments

Comments

@Turum
Copy link

Turum commented Sep 19, 2022

Hi,
Could you please check, getting "raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)" error when trying to get economic calendar. It falled on this string

req = requests.post(url, headers=headers, data=data)
root = fromstring(req.json()["data"])

May be I'm using it incorrectly, or investing stopped responded in xml format?

@Turum Turum changed the title raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1) raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1) when trying to get economic calendar. Sep 19, 2022
@mscharstrom
Copy link

mscharstrom commented Oct 13, 2022

I am also having this problem, example code:

import investpy

data = investpy.economic_calendar(
from_date = '13/10/2022',
to_date = '24/10/2022',
importances = ['high'],
countries = ['united states', 'euro zone']
)
print(data.head(100))

Error message: requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0).

Used to work fine. Maybe it has to do with investing.com adding cloudflare and/or changing their API?

@varshasahasrabuddhe
Copy link

I am also facing same problem
investpy.economic_calendar(time_zone = "GMT", countries = ["United States"], importances = ['high','medium','low'],from_date= get_exogs_from, to_date = get_exog_to)
with error as follows

Expecting value: line 1 column 1 (char 0)

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

3 participants