我正在尝试从 Yahoo 实时 API 获取 SPY 价格,该代码过去可以工作,但现在我收到此错误(如下),我该如何克服这个问题
library(rjson)
json_file <- "http://finance.yahoo.com/webservice/v1/symbols/SPY/quote?format=json&view=detail"
json_data <- fromJSON(paste(readLines(json_file), collapse=""))
json_data
我收到此错误:
"Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open URL 'http://finance.yahoo.com/webservice/v1/symbols/AA/quote?format=json&view=detail': HTTP status was '406 Not Acceptable'