yahoofinancials icon indicating copy to clipboard operation
yahoofinancials copied to clipboard

Get_financial_stmts still return None

Open syrakusmrdrte opened this issue 4 years ago • 10 comments

I have tried and tried to search for solutions, but ticker="AAPL" YahooFinancials(ticker).get_financial_stmts("annual",["income","cash","balance"]) returns {'incomeStatementHistory': {'AAPL':None}, 'cashflowStatementHistory':{'AAPL':None}, 'balanceSheetHistory':{'AAPL':None}}

Is there any way to solve this so that I get the financial statements?

syrakusmrdrte avatar May 13 '20 21:05 syrakusmrdrte

I have got the same issue. Anyone has any insight?

CDCDM1986 avatar Jun 14 '20 01:06 CDCDM1986

Also had the same issue after adding the BeautifulSoup fix, that I got these None results.

@syrakusmrdrte, @CDCDM1986 I Fixed it by adding the second user-agent header change fix. Perhaps Yahoo is blocking the previous one, but seems like they at least respond HTTP 200 so not sure.

biggestT avatar Jun 28 '20 19:06 biggestT

Hey biggestT. I did quite understand your solution.

Wenseslaus avatar Jun 29 '20 11:06 Wenseslaus

wow @biggestT thank you that fixed it!!

avelaga avatar Jul 18 '20 17:07 avelaga

wow @biggestT thank you that fixed it!!

Can you tell me what did you do?

Frodriguez9 avatar Sep 25 '20 02:09 Frodriguez9

Also had the same issue after adding the BeautifulSoup fix, that I got these None results.

@syrakusmrdrte, @CDCDM1986 I Fixed it by adding the second user-agent header change fix. Perhaps Yahoo is blocking the previous one, but seems like they at least respond HTTP 200 so not sure.

I'm sorry, I am a beginner programer. I am not sure what to do with that information, can you tell me how to actually apply your solution?

My biggest appreciation in advance!

Frodriguez9 avatar Sep 25 '20 03:09 Frodriguez9

@Frodriguez9 i made the edits in the yahoofinancials/__init__.py that was linked to. here's the fully fixed file that works for me - https://gist.github.com/avelaga/762142a778c2e3a969fbb78ec351d6e8

you want to replace /yahoofinancials/__init__.py with this fixed __init__.py file. if you can't find the package, run the following: python3 to open a python shell

import sys
print(sys.path)
exit()

to find the python path and search through those to find yahoofinancials

these are the file paths where i found it on different machines: in aws: /usr/local/lib/python3.7/site-packages/yahoofinancials in raspian: /home/pi/.local/lib/python3.7/site-packages/yahoofinancials in macos: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/yahoofinancials

hope that helps!

avelaga avatar Sep 25 '20 03:09 avelaga

@avelaga thank you so much! it worked!.

I was telling a friend that one of the things I've enjoyed the most since I started to become involved with IT was to find such helpful community of programers. You guys are always willing to assist others.

No wonder why IT keeps evolving more rapidly than all other industries combined. Thank you so much!

Frodriguez9 avatar Sep 26 '20 01:09 Frodriguez9

@Frodriguez9 awesome!! yeah the online community is amazing, i've gotten a ton of help myself on reddit especially. its an amazing field and really rewarding to share it with others. im glad i could help :)

avelaga avatar Sep 26 '20 14:09 avelaga

@biggestT That solution works for me too! Many thanks!

wwang184 avatar Nov 10 '20 05:11 wwang184