Tired of "403 Error Retry later" error from InvestPy package. Decided to create this tiny script that uses Selenium WebDriver to retrieve the last 30 days of any financial Instrument.
You can get any of the listing from Investing.com from Futures, Indices, Stocks and Currencies.
Just clone this repostiory
git clone git@github.com:amircp/investingpy.git
pip install -r requirements.txt
In your code editor:
from investingpy import datafeed
df = datafeed.get_investing_last30days_data("microsoft-corp", "equities")
print(df.head())
and then we get the Microsoft Historical data frame:
Some times the response could last a few large seconds due to investing.com blocking requests while selenium driver keeps waiting for them (they need to timeout).
- Create the capability to select date ranges from table
- Add some architecture using classes
- Convert to a Package and submit to Pypi