Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in get_earnings_history #100

Open
derekfunguk opened this issue Feb 7, 2023 · 2 comments
Open

Problem in get_earnings_history #100

derekfunguk opened this issue Feb 7, 2023 · 2 comments

Comments

@derekfunguk
Copy link

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?

@udank23
Copy link

udank23 commented Jul 1, 2023

Hi,

Did you solve this? Any advice on how to access earning history for a given ticker?

Thanks

@vanitoz
Copy link

vanitoz commented Feb 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants