yahoofinancials icon indicating copy to clipboard operation
yahoofinancials copied to clipboard

ValueError: read of closed file from blank yahoofinance page

Open dalder1 opened this issue 4 years ago • 2 comments

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

dalder1 avatar May 09 '20 04:05 dalder1

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.

sylvandb avatar May 19 '20 14:05 sylvandb

Awesome thank a lot

dalder1 avatar May 19 '20 16:05 dalder1