2

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>
nicomp
  • 4,045
  • 4
  • 21
  • 47

1 Answers1

2

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.

Shunya
  • 2,191
  • 2
  • 15
  • 27