RCurl getURL()函数做debug

 

getURL()函数做获取网页做debug,三步骤

1、首先创建一个对象debugGatherer(),该对象包含三个函数:(update(), value(), reset());

R> debugInfo <- debugGatherer()
R> names(debugInfo)
[1] "update" "value" "reset"
R> class(debugInfo[[1]])
[1] "function"

2、然后请求一个url使用getURL(debugfunction,verbose=TRUE),注意参数debugfunciton和参数vervose

res <- getURL(url = url, debugfunction = debugInfo$update,verbose = T)

 

3、然后利用函数 value()访问 debugInfo,注意返回值

R> names(debugInfo$value())
[1] "text" "headerIn" "headerOut" "dataIn" "dataOut"
[6] "sslDataIn" "sslDataOut"

 

posted @ 2015-10-21 17:42  随遇而安jason  阅读(1029)  评论(0编辑  收藏  举报