alvarobartt / investpy

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

API not working + Error Handling (Error 111 + Error 110) #485

Open QuantumCrazy opened 2 years ago

QuantumCrazy commented 2 years ago

Hi, I usually grab data every day using investpy but since yesterday it has not been working. I normally grab indices, FX, commodities, US treasuries but it has been throwing me Error 110 (time out) and Error 111 (connection refused).

I usually use the requests package in python with other api's and have written some code to handle exceptions, but for this api, what's the best way to handle http exceptions? And why are these errors happening? Has anything changed lately?

Update: I managed to resolve the errors, but the part of my question about exception handling still stands - can somebody please advise good error handling practice for investpy?