alvarobartt / investpy

Financial Data Extraction from Investing.com with Python
https://investpy.readthedocs.io/
MIT License
1.59k stars 374 forks source link

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 1 year ago

Turum commented 1 year ago

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?

mscharstrom commented 1 year ago

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 commented 1 year ago

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)