Open KalinNonchev opened 2 years ago
Dear investpy authors, Is it possible to add custom proxy optional parameter to get_data() function? thanks
You can create a list of tickers and write a loop with time.sleep(5) to go through them. I've been trying it for a few days, and I haven't been blocked yet. I can't guarantee this will always work, but for now, it seems to be the only solution.
Hi Karim, would you mind sharing the code? This issue is quite blocking.
@simona-juv It would look like
import time
stocks = ["A", "B"]
for stock in stocks:
data = investpy.get_stock_historical_data(stock=stock,
country='XXX',
from_date='01/01/2020',
to_date='01/01/202')
time.sleep(5)
but we still need better solution, otherwise it takes days to query the data for a bunch of stocks.
@KalinNonchev thank you, it should work for the moment. But you're right, it would take ages.
I wrote the tessa package to help with issues such as these. It also implements a more generic solution to the 429 error. See here: https://github.com/alvarobartt/investpy/issues/557
Hello,
Thanks for the great package! I saw that you are aware of the problem that you are banned when you query information for multiple stocks in a short period of time - https://github.com/alvarobartt/investpy/issues/469. Query for multiple stocks in a single request was also suggested recently - https://github.com/alvarobartt/investpy/issues/57. I would like to ask if you are reevaluating this feature(to query data for multiple stocks in a single website request)? Knowing how many times you can query before getting a ban is not really a long term solution. It is annoying that you get banned for 2 days if you go over this threshold. I think that the multiple stock query is the only sustainable software decision that would solve the problem with Error 429 and significantly relax the burden on Investing.com.
I could imagine that the syntax is like:
What do you think?
Best,