私はPythonでyahoo financeモジュールを使用してきました。私はこの数ヶ月間プロジェクトを停止し、もう一度それを開始しました。残念ながら、もうヤフーファイナンスモジュールの後ろに何かがあるようには見えません!Yahoo-Financeモジュールはもう動作しませんか?
私はpypi documentsからサンプルコードを実行し、何も戻っていません。
>>> from yahoo_finance import Share
>>> yahoo = Share('YHOO')
>>> print yahoo.get_open()
None
>>> print yahoo.get_price()
None
>>> print yahoo.get_trade_datetime()
None
私はGOOGのために開くことができましたが、私は過去のデータにアクセスしようとするとエラーを取得し、任意の株式の過去のデータにアクセスするように見えることはできません。
None
>>> goog = Share('GOOG')
>>> goog.get_open()
'956.83'
>>> print(yahoo.get_open())
None
>>> goog.get_historical('2014-04-25', '2014-04-29')
Traceback (most recent call last):
File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\site-packag
es\yahoo_finance\__init__.py", line 120, in _request
_, results = response['query']['results'].popitem()
AttributeError: 'NoneType' object has no attribute 'popitem'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\site-packag
es\yahoo_finance\__init__.py", line 123, in _request
raise YQLQueryError(response['error']['description'])
KeyError: 'error'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\site-packag
es\yahoo_finance\__init__.py", line 342, in get_historical
result = self._request(query)
File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\site-packag
es\yahoo_finance\__init__.py", line 125, in _request
raise YQLResponseMalformedError()
yahoo_finance.YQLResponseMalformedError: Response malformed.
>>>
私は最近の日付範囲と運がない状態で実行しようとしました。歴史的なデータはモジュールから利用できないようで、わずか数週間前には信頼できるものでした。どんな洞察?ここEd0906の答えから
これは役に立つかもしれないhttps://stackoverflow.com/questions/43149200/python-and-yahoo-finance-weird-yqlqueryerrorresponseerrordescription – Valilutzik
私は数ヶ月前のように書いた回避策を理解しています。 https://gist.github.com/Krewn/0e624d35c396df63262dd42d74f2beb6 私が理解できないのは、なぜ誰もがpythonモジュールを管理していないということです。 – kpie