-5

我在 R 论坛上问过这个问题,但没有得到任何答案。因此我在这里碰碰运气,希望有人能给我宝贵的建议。

我正在尝试从该站点获取数据: http ://www.cmegroup.com/trading/agriculture/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)

如果有人给我一些相同的信息,我将不胜感激。

非常感谢。

4

1 回答 1

3

从 yahoo 获取数据怎么样?

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
于 2013-09-17T22:56:53.390 回答