我在R论坛上问了这个问题,但是没有得到任何答案。所以我在这里试试运气,希望有人能给我宝贵的建议。
我正在尝试从此网站获取数据: http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/corn_quotes_globex.html
因此我尝试了以下内容:
library(RCurl)
library(XML)
aa <- getURL("http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/corn_quotes_globex.html")
readHTMLTable(aa)
如果有人给我一些相同的话,我将非常感激。
非常感谢。
答案 0 :(得分:3)
如何从雅虎获取数据呢?
library(quantmod)
symbols <- c("ZCZ13.CBT", "ZCH14.CBT", "ZCK14.CBT", "ZCN14.CBT", "ZCU14.CBT",
"ZCZ14.CBT", "ZCH15.CBT", "ZCN15.CBT", "ZCU15.CBT", "ZCZ15.CBT",
"ZCN16.CBT", "ZCZ16.CBT")
getQuote(symbols)
Trade Time Last Change % Change Open High Low Volume
ZCZ13.CBT 2013-09-17 06:08:00 454.00 -2.50 -0.55% 457.00 468.50 453.25 135002
ZCH14.CBT 2013-09-17 06:07:00 466.50 -2.50 -0.53% 469.75 480.50 465.75 25952
ZCK14.CBT 2013-09-17 06:08:00 474.75 -2.50 -0.52% 478.00 488.50 473.75 9065
ZCN14.CBT 2013-09-17 06:08:00 481.50 -2.25 -0.47% 484.50 495.00 480.25 10312
ZCU14.CBT 2013-09-17 06:08:00 485.50 -0.75 -0.15% 489.25 496.75 485.00 1420
ZCZ14.CBT 2013-09-17 06:08:00 492.75 -3.00 -0.61% 495.75 504.00 492.00 7846
ZCH15.CBT 2013-09-17 06:08:00 502.50 -2.75 -0.54% 505.00 509.25 502.00 112
ZCN15.CBT 2013-09-17 06:08:00 519.00 8.25 +1.62% 519.00 519.00 519.00 15
ZCU15.CBT 2013-09-17 06:08:00 507.00 5.50 +1.10% 507.00 507.00 507.00 5
ZCZ15.CBT 2013-09-17 06:08:00 500.00 0.75 +0.15% 503.00 508.75 499.00 157
ZCN16.CBT 2013-09-17 06:08:00 510.25 -2.50 -0.49% 510.25 510.25 510.25 2
ZCZ16.CBT 2013-09-17 06:08:00 501.75 2.75 +0.55% 505.00 505.00 501.75 7