alvarobartt / investpy

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

Failing connecting to Investing.com for any data #309

Closed mrjapon closed 3 years ago

mrjapon commented 3 years ago

When executing a basic order: << import investpy df__ = investpy.get_stock_recent_data(stock='bbva', country='spain')

An error occurs (see below). Not sure if it's a problem with my connection or installation, or a general issue.

HTTPSConnectionPool(host='www.investing.com', port=443): Max retries exceeded with url: /instruments/HistoricalDataAjax (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)')))

Thank you

alvarobartt commented 3 years ago

Hi @mrjapon, I've just tested it and it works fine for me, see below.

Python 3.7.10 (default, Feb 26 2021, 13:06:18) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import investpy
>>> data = investpy.get_stock_recent_data(stock="bbva", country="spain")
>>> data.head()
             Open   High    Low  Close    Volume Currency
Date
2021-02-18  4.426  4.499  4.385  4.449  19760400      EUR
2021-02-19  4.446  4.538  4.391  4.505  15336800      EUR
2021-02-22  4.480  4.507  4.410  4.474  17051900      EUR
2021-02-23  4.482  4.620  4.482  4.590  28839000      EUR
2021-02-24  4.590  4.630  4.542  4.630  15645500      EUR

Maybe that issue has anything to do either with your connection or with the Investing.com status at the moment you sent the request, but investpy seems to be working fine. Let me know if the error persists, and provide me more information so that I can help you! 🤗

mrjapon commented 3 years ago

Just checked my connection (I use a VPN) and that was the problem, the VPN. Without the VPN connection active, it works perfectly.

Thank you!!