mqtran01/python-yahoofinance

ValueError: Cookie not found

Opened this issue · 2 comments

0a1b commented

Has there been a change at yahoo regarding cookies?

KeyError                                  Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/yahoofinance/historicaldata.py in _find_cookie_crumb_pair(self, locale)
     71         #try:
---> 72             #cookie = res.cookies['B']
     73         #except KeyError:

4 frames
KeyError: "name='B', domain=None, path=None"

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/yahoofinance/historicaldata.py in _find_cookie_crumb_pair(self, locale)
     72             #cookie = res.cookies['B']
     73         #except KeyError:
---> 74             #raise ValueError("Cookie not found")
     75 
     76         # TODO: Consider bs4 to make processing faster?

ValueError: Cookie not found

Anyone else experienced this issue?

gg-bt commented

I got the very same issue since yesterday. Before that, it was working just like a charm.

gg-bt commented

@0a1b since I don't want to spend time in debugging this I have tried to find an alternative to this library and I have found panda data reader.
Now, I don't know what you are using this library for but i am using it for retrieveing historical data for crypto currencies.
A quick exampe

importpandas_datareader as web
cryptoHistory = web.DataReader(symbol, 'yahoo', inceptionDate, today)

cryptoHistory will be a panda dataframe as per the call of the API from yahoofinance. To me it was not much of an effort to switch between the two.
I hope this can help you.