我正在使用ystockquote.py,这是由Corey Goldberg创建的Yahoo Finance API。我正在导入模块,当我尝试
时ystockquote.get_historical_prices('GOOG', '2013-01-03', '2013-01-08')
我收到错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ystockquote.py", line 485, in get_historical_prices
resp = urlopen(req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found
我不知道出了什么问题,因为我认为API是正确创建的,因为Goldberg在github上显示正确的结果。 Corey Goldberg的旧版ystockquote.py也给出了错误。