ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
12.42k stars 2.25k forks source link

Ticker Attribute "calendar" is not populating for any symbols #1437

Closed pmgh2345 closed 3 months ago

pmgh2345 commented 1 year ago

This attribute, a DataFrame, is not populating, meaning that one can't access the columns that would give us earnings dates among much other useful info.

yf.Ticker('AAPL').calendar

`Traceback (most recent call last):

File "", line 1, in yf.Ticker('AAPL').calendar

File "C:\Users\Owner\Anaconda3\envs\x1\lib\site-packages\yfinance\ticker.py", line 142, in calendar return self.get_calendar()

File "C:\Users\Owner\Anaconda3\envs\x1\lib\site-packages\yfinance\base.py", line 1445, in get_calendar data = self._quote.calendar

File "C:\Users\Owner\Anaconda3\envs\x1\lib\site-packages\yfinance\scrapers\quote.py", line 115, in calendar self._scrape(self.proxy)

File "C:\Users\Owner\Anaconda3\envs\x1\lib\site-packages\yfinance\scrapers\quote.py", line 124, in _scrape json_data = self._data.get_json_data_stores(proxy=proxy)

File "C:\Users\Owner\Anaconda3\envs\x1\lib\site-packages\yfinance\data.py", line 41, in wrapped return func(*args, **kwargs)

File "C:\Users\Owner\Anaconda3\envs\x1\lib\site-packages\yfinance\data.py", line 292, in get_json_data_stores keys = self._get_decryption_keys_from_yahoo_js(soup)

File "C:\Users\Owner\Anaconda3\envs\x1\lib\site-packages\yfinance\data.py", line 210, in _get_decryption_keys_from_yahoo_js re_data = json.loads(re.search("root.App.main\s+=\s+({.*})", re_script).group(1))

AttributeError: 'NoneType' object has no attribute 'group'`

ValueRaider commented 1 year ago

Fixing this specific error is pointless because decryption isn't working anyway #1407

williamc1998 commented 1 year ago

I think this is related to my error with news. Did it also only start for you today or yesterday?

ValueRaider commented 1 year ago

I don't have this error

pmgh2345 commented 1 year ago

@williamc1998 I began getting this error on the 28th of February, though I am not entirely sure it had been running fine before that, as I'm not sure the last time I ran the script that would have tested it.