之前我运行过此代码,Google财经过去常常在它返回的字典中给出我的红利和收益。现在,如果它不会出现在这本词典中,我如何获得这些数据呢?
from googlefinance import getQuotes
import json
print(json.dumps(getQuotes('D'), indent=2))
过去的回归:
[
{
"ID": "10020",
"StockSymbol": "D",
"Index": "NYSE",
"LastTradePrice": "77.96",
"LastTradeWithCurrency": "77.96",
"LastTradeTime": "4:01PM EDT",
"LastTradeDateTime": "2017-08-08T16:01:05Z",
"LastTradeDateTimeLong": "Aug 8, 4:01PM EDT",
"Dividend": "0.75",
"Yield": "3.87"
}
]
现在只返回:
[
{
"ID": "10020",
"StockSymbol": "D",
"Index": "NYSE",
"LastTradePrice": "77.96",
"LastTradeWithCurrency": "77.96",
"LastTradeTime": "4:01PM EDT",
"LastTradeDateTime": "2017-08-08T16:01:05Z",
"LastTradeDateTimeLong": "Aug 8, 4:01PM EDT",
}
]