-
Notifications
You must be signed in to change notification settings - Fork 213
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
yahoo_financials.get_key_statistics_data() TypeError: string indices must be integers #105
Comments
I have the same problems "TypeError: string indices must be integers" |
same issue with getting last value, however the website appears up and running, @chingybrooks what do you mean with your comment? |
+1 |
I thought the reason is that the API is not available |
I think the data is coming back encoded and or encrypted. Beyond my capabilities to fix, but looks that way. |
I have created a pull request with the fix hopefully it will be accepted too. I found the fix on a separate package: ranaroussi/yfinance@8e5f098 |
Yes, same issue on my side. |
I also get the same issue using yahoo_financials.get_current_price() method. Any update on this issue? |
check the answer from sedwards2000 updating the file worked for me. But make sure you also have crypto module installed |
Hey, I am new to GitHub and I faced the same issue and now here is the fix but I don't know what to do with the code given, like should I execute it or what am I suppose to do |
Hi! You have to change the source code yourself applying the changes highlighted in the pull request. 62119be You have to modify yahoofinancials module’s
Apply the changes and that's it! Just make sure you have "pycryptodome" module installed |
One easy way to install working Thanks @sedwards2000 Code:
OUTPUT:
|
It worked thanks a lot |
Looking at the MR now @divyankm |
@githubkingchamp I merged in the fix from @sedwards2000 and just released v1.7. Please let me know if there's anymore issues, I'll be more attentive. |
yahoo_financials.get_key_statistics_data(), Suddenly started throwing error: TypeError: string indices must be integers. Not sure anybody using this python module experiencing the error.
`from yahoofinancials import YahooFinancials
ticker = 'AAPL'
yahoo_financials = YahooFinancials(ticker)
conentKeys = yahoo_financials.get_key_statistics_data()
File "/Users/raj/opt/miniconda3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/raj/opt/miniconda3/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/raj/.vscode/extensions/ms-python.python-2022.20.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/main.py", line 39, in
cli.main()
File "/Users/raj/.vscode/extensions/ms-python.python-2022.20.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/Users/raj/.vscode/extensions/ms-python.python-2022.20.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
runpy.run_path(target, run_name="main")
File "/Users/raj/.vscode/extensions/ms-python.python-2022.20.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "/Users/raj/.vscode/extensions/ms-python.python-2022.20.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/Users/raj/.vscode/extensions/ms-python.python-2022.20.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "/Users/raj/Code/Machine_Learning/wb-starter/scrap_yahoo_finance3.py", line 7, in
conentKeys = yahoo_financials.get_key_statistics_data()
File "/Users/raj/opt/miniconda3/lib/python3.8/site-packages/yahoofinancials/init.py", line 613, in get_key_statistics_data
return self.get_clean_data(self.get_stock_tech_data('defaultKeyStatistics'), 'defaultKeyStatistics')
File "/Users/raj/opt/miniconda3/lib/python3.8/site-packages/yahoofinancials/init.py", line 492, in get_stock_tech_data
return self.get_stock_data(statement_type='keystats', tech_type=tech_type)
File "/Users/raj/opt/miniconda3/lib/python3.8/site-packages/yahoofinancials/init.py", line 476, in get_stock_data
dict_ent = self._create_dict_ent(self.ticker, statement_type, tech_type, report_name, hist_obj)
File "/Users/raj/opt/miniconda3/lib/python3.8/site-packages/yahoofinancials/init.py", line 409, in _create_dict_ent
re_data = self._scrape_data(YAHOO_URL, tech_type, statement_type)
File "/Users/raj/opt/miniconda3/lib/python3.8/site-packages/yahoofinancials/init.py", line 169, in _scrape_data
stores = data["context"]["dispatcher"]["stores"]["QuoteSummaryStore"][tech_type]
TypeError: string indices must be integers
`
The text was updated successfully, but these errors were encountered: