Open derekfunguk opened 1 year ago
Hi,
Did you solve this? Any advice on how to access earning history for a given ticker?
Thanks
This Issue not solved yet. I'm getting the same error. Problem is that this library works trough scraping data from yahoo. When Yahoo change their web page structure yahoo_fin need to change their script also to scrape data.
The following is my python code -
import yahoo_fin.stock_info as si import pandas as pd import pandas_datareader.data as pddata from datetime import datetime, date, timedelta from functools import reduce today = datetime.today().strftime('%Y-%m-%d') ticker=input().upper() stock_earnings_hist = si.get_earnings_history(ticker)
And the following is the error message: /usr/local/lib/python3.8/dist-packages/yahoo_fin/stock_info.py in get_earnings_history(ticker) 836 result = _parse_earnings_json(url) 837 --> 838 return result["context"]["dispatcher"]["stores"]["ScreenerResultsStore"]["results"]["rows"] 839 840
TypeError: string indices must be integers
Can anyone help?