萧楠版主在
给出的代码是下载回购利率历史数据的,代码如下
require(RCurl)
require(XML)
url = 'http://www.chinamoney.com.cn/fe-c/repoFixInterestRateHistoryDataAction.do?startDate=2012-11-04&endDate=2012-12-03'
doc = getURL(url)
txt = htmlParse(doc)
tab = readHTMLTable(txt, which = 4, header = FALSE)
小作改动下载SHibor历史数据
require(RCurl)
require(XML)
url = 'http://www.chinamoney.com.cn/fe-c/shiborHistoricalDataExportAction.do?startDate=2015-01-04&endDate=2015-04-03'
doc = getURL(url)
txt = htmlParse(doc)
tab = readHTMLTable(txt, which = 4, header = FALSE)
但不知为何,不成功,显示
doc = getURL(url)
Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) :
embedded nul in string: 'ÐÏ21ࡱ32á'
哪位大侠看看问题何在?先表示感谢!!