You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: