【问题标题】:Google FInance Code Throwing Error谷歌金融代码抛出错误
【发布时间】:2018-07-07 12:00:15
【问题描述】:

我正在尝试这里的示例代码。

http://pandas-datareader.readthedocs.io/en/latest/remote_data.html#remote-data-google

import pandas_datareader.data as web
import datetime

start = datetime.datetime(2010, 1, 1)
end = datetime.datetime(2013, 1, 27)

f = web.DataReader("F", 'google', start, end)
f.ix['2010-01-04']

我收到此错误:

RemoteDataError: Unable to read URL: http://www.google.com/finance/historical?q=F&startdate=Jan+01%2C+2010&enddate=Jan+27%2C+2013&output=csv

这里有人知道可能出了什么问题吗?我正在使用 Spyder 3.2.4。

【问题讨论】:

  • 该网址已失效。我以前从未查询过它,但仍然收到错误消息。我猜他们把它关了。
  • 你用浏览器试试这个网址吗?

标签: python python-3.x pandas dataframe spyder


【解决方案1】:

似乎 google 不希望你这样做:

http://www.google.com/finance/historical?q=F&startdate=Jan+01%2C+2010&enddate=Jan+27%2C+2013&output=csv

很抱歉... ...但您的计算机或网络可能正在发送 自动查询。为了保护我们的用户,我们无法处理您的请求 现在。

有关详细信息,请参阅 Google 帮助。

【讨论】:

  • 啊。据我所知,雅虎在去年 5 月贬值了它所有的金融产品。这些天人们去哪里免费获得历史股票数据?
  • 您可以通过直接包装 html 响应来从 yahoo 获取历史数据。我就是这样做的。否则你必须为数据付费
  • Stephan,你是怎么做到的?你能发布一些示例代码吗?谢谢。
猜你喜欢
  • 2018-01-27
  • 1970-01-01
  • 2018-02-18
  • 1970-01-01
  • 2018-04-27
  • 2015-11-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多