I run this code (JupyterLab, but probably not relevant?)
from yahoo_finance import Share
yahoo = Share('YHOO')
print ( yahoo.get_open())
I get this error on the reference to Share:
RLError: <urlopen error [Errno 11001] getaddrinfo failed>
I run this code (JupyterLab, but probably not relevant?)
from yahoo_finance import Share
yahoo = Share('YHOO')
print ( yahoo.get_open())
I get this error on the reference to Share:
RLError: <urlopen error [Errno 11001] getaddrinfo failed>
Yahoo's finance API has been discontinued since the 17th of May of 2017.
Your code fails because yahoo_finance
library was using the public API from Yahoo's finance. Nowadays there are other alternatives such as using yfinance, whose functionalities are pretty similar to the old yahoo_finance
.