investpy
investpy copied to clipboard
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.
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?
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?
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)