我正在尝试解析网站的内容,但收到一条错误消息。我不知道如何处理错误:
require(RCurl)
require(XML)
html <- getURL("http://www.sec.gov/Archives/edgar/data/8947/000119312506125763/0001193125-06-125763.txt")
doc <- htmlParse(html, asText=TRUE)
这是我收到的错误消息:
错误:XML 内容似乎不是 XML,也无法识别文件名
我在 Mac 上工作:
> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] plyr_1.8 rJava_0.9-4 R.utils_1.26.2 R.oo_1.13.9 R.methodsS3_1.4.4 gsubfn_0.6-5 proto_0.3-10 RCurl_1.95-4.1
[9] bitops_1.0-6 splus2R_1.2-0 stringr_0.6.2 foreign_0.8-54 XML_3.95-0.2
loaded via a namespace (and not attached):
[1] tcltk_3.0.1 tools_3.0.1
关于如何解决这个问题的任何想法?