alvarobartt / investpy

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

investpy.news.economic_calendar() obtains no data from request #411

Open Okaca opened 3 years ago

Okaca commented 3 years ago

I have been trying the new version now, the previous version get_calendar was working fine. However, in the new version, the request was probably returning null, because the function raises an error in the lines;

req = requests.post(url, headers=headers, data=data)

root = fromstring(req.json()['data'])

I have tried the function with filled parameters and in default mode too, but I receive no data. The line below gives the error

raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The problem might be because of my incompetence too, please try to guide me

alvarobartt commented 3 years ago

Hi @Okaca I'll check this later today and come back to you with an answer, but it seems that you are using the function properly, so the error may be related to the function itself not on how you use it. Anyway, let me check and I'll try to provide you a solution for this :+1: