无法使用pandas_datareader.data从yahoo下载历史数据(google无论如何不提供)。这种方法在大多数情况下都很有效,但自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
...)
但他们已经很久没能纠正它了。有人能提出一些替代方案或解决方法吗?
1条答案
按热度按时间q43xntqr1#
这是yfinance的一个实际公开问题,您可以按照公开的票证了解更多细节问题#607