如何解决使用 pandas 接收历史股票数据时出错
无法使用 pandas_datareader.data 从雅虎下载历史数据(无论如何谷歌不提供)。过去大部分时间都可以正常工作,但自 2021 年 7 月以来就不是这样了。我的代码:
import pandas_datareader.data as web # including other required classes as per my requirement
def get_data(ticker,start_time,end_time):
connected = False
while not connected:
try:
df = web.get_data_yahoo(ticker,start=start_time,end=end_time)
connected = True
........
except Exception as e:
........
pass
return df
我一直收到此错误消息:
Unable to read URL... ( with the message.
Will be right back...</h1>\n <p id="message-1">Thank you for your patience.</p>\n <p id="message-2">Our engineers are working quickly to resolve the issue
...)
但是他们已经很久没有能够纠正它了。任何人都可以提出一些替代方案或解决方法吗?
解决方法
这是 yfinance 的实际未解决问题,您可以关注未解决的问题以获得更多见解ISSUE #607
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。