yahoofinancials
yahoofinancials copied to clipboard
ValueError: read of closed file from blank yahoofinance page
When I call get_historical_price_data on a group of stocks if there is trouble returning any one of the stock's data I get this error and the program stops.
I am using the sp500 stocks and through trial and error have found that there are two stocks that cause this error because they have blank yahoofinance pages. The stocks are "BF.B" and "BRK.B".
What I am looking for is a way for the call to progress, so that when it finds these errored stocks it recognizes they error but then still continues on. I am thinking a try except block could fix this but am not familiar with the library codebase.
I also see that there was an issue like this a while back but it is closed so I assume this is a new issue
The yahoo ticker seems to be BF-B and BRK-B (a dash not a dot). This applies also to other companies with multiple share classes such as RDS.
Awesome thank a lot