为什么调用 Share 会导致错误?

Why does this call to Share cause an error?

我运行这段代码(JupyterLab,但可能不相关?)

from yahoo_finance import Share
yahoo = Share('YHOO')
print ( yahoo.get_open())

我在引用共享时收到此错误:

RLError: <urlopen error [Errno 11001] getaddrinfo failed>

雅虎的财务 API 自 2017 年 5 月 17 日以来一直

您的代码失败,因为 yahoo_finance 库正在使用来自 Yahoo's finance 的 public API。现在还有其他替代方法,例如使用 yfinance,其功能与旧的 yahoo_finance.

非常相似