Problems with urlread/webread

10 views (last 30 days)
Mario Trevino
Mario Trevino on 17 Jul 2020
Edited: Mario Trevino on 17 Jul 2020
Hi there everyone
Im using a function to download stock prices from yahoo finance. The function works well with most of the tickers but it fails sometimes. Debugging the function, I realized that the problem is localized to line 168, where it calls 'urlread'. It turns out that the URL is correct, and if I place it in a browser, I do see a CSV file with the propper data.... however, the urlead function is failing to bring that info to the workspace.
you can replicate the problem calling the following:
stocks = hist_stock_data(now-100,now,'NVDA','frequency','d');
(you can debug the function in line 168, and see how the url works fine in a webbrowser)
and, for example, it works with
stocks = hist_stock_data(now-100,now,'SPY','frequency','d')
my guess is that it should be something very simple with respect to urlread / webread. Maybe some expert can help me with this.
thanks in advance

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!