【问题标题】:YQLResponseMalformedError: Response malformed on yahoo_finance?YQLResponseMalformedError:yahoo_finance 上的响应格式错误?
【发布时间】:2017-05-18 03:15:56
【问题描述】:

yahoo_finance 的 get_historical 函数对我来说一直运行良好,直到昨天。

现在每次我尝试调用 get_historical 时它都会不断给我 YQLResponseMalformedError。有任何想法吗?我确实对代码没有做任何新的事情。

from yahoo_finance import Share
yahoo = Share('YHOO')
yahoo.refresh()
yahoo.get_historical('2014-04-26', '2014-04-29')
---------------------------------------------------------------------------
YQLResponseMalformedError                 Traceback (most recent call last)
<ipython-input-8-fbc20f9b6d26> in <module>()
----> 1 yahoo.get_historical('2014-04-26', '2014-04-29')

/Users/anjian/anaconda/lib/python2.7/site-packages/yahoo_finance-1.4.0-py2.7.egg/yahoo_finance/__init__.pyc in get_historical(self, start_date, end_date)
    340             try:
    341                 query = self._prepare_query(table='historicaldata', startDate=s, endDate=e)
--> 342                 result = self._request(query)
    343                 if isinstance(result, dict):
    344                     result = [result]

/Users/anjian/anaconda/lib/python2.7/site-packages/yahoo_finance-1.4.0-py2.7.egg/yahoo_finance/__init__.pyc in _request(self, query)
    123                 raise YQLQueryError(response['error']['description'])
    124             except KeyError:
--> 125                 raise YQLResponseMalformedError()
    126         else:
    127             if self._is_error_in_results(results):

YQLResponseMalformedError: Response malformed.

【问题讨论】:

标签: python ipython yahoo-finance


【解决方案1】:
猜你喜欢
  • 2016-05-20
  • 2013-07-31
  • 2015-12-02
  • 2019-10-13
  • 1970-01-01
  • 2021-01-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多