JECSand / yahoofinancials

A powerful financial data module used for pulling data from Yahoo Finance. This module can pull fundamental and technical data for stocks, indexes, currencies, cryptos, ETFs, Mutual Funds, U.S. Treasuries, and commodity futures.
https://pypi.python.org/pypi/yahoofinancials
MIT License
910 stars 215 forks source link

TypeError: can only concatenate str (not "NoneType") to str #175

Open Edison0019 opened 9 months ago

Edison0019 commented 9 months ago

When trying to use any of the get_* methods I'm getting this error:

image

netjens commented 9 months ago

the self.crumb attribute is None, not sure what this crumb is about , but call of
response = session.get('https://fc.yahoo.com') fails in sessions.py, therefore crumb is None

JECSand commented 9 months ago

@Edison0019 I'm unable to reproduce this error. I have tried from both US and EU IPs.

@netjens Yahoo is in the process of evolving their APIs. This makes sense, given their last major evolution was about 7 years ago now. Part of this evolution is requiring a cookie and crumb to make requests. Due to the current state of everything, I've been focused on hardening YF to minimize the impacts of this transition.

I'll include additional hardening to better handle null crumbs in v1.21, which I plan to have out before New Years.

Once Yahoo stabilizes again (hopefully sometime next year), I'm going to do a full rewrite of this library.