atreadw1492 / yahoo_fin

Scrape stock price history from new (Spring 2017) Yahoo Finance layout
MIT License
286 stars 125 forks source link

Error while calling get_earnings(ticker) #35

Closed guileluk closed 3 years ago

guileluk commented 3 years ago

File "C:\Users\Acer\Desktop\Ray\test\venv\lib\site-packages\yahoo_fin\stock_info.py", line 765, in get_earnings result["quarterly_results"] = pd.DataFrame.from_dict(temp["earningsChart"]["quarterly"]) TypeError: 'NoneType' object is not subscriptable

guileluk commented 3 years ago

e.g. get_earnings('2800.HK')

atreadw1492 commented 3 years ago

Some tickers may not have earnings information freely available, like 2800.HK (see https://finance.yahoo.com/quote/2800.HK/financials?p=2800.HK for example). That's what's causing the issue.