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,344
  • 4
  • 27
  • 60

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,344
  • 4
  • 16
  • 28