我之前运行过这段代码,谷歌金融过去常常在它返回的字典中给我股息和收益率。既然它不会出现在这本字典中,我该如何获取这些数据?
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",
}
]