Displaying 1 result from an estimated 1 matches for "cookie_1".
2010 Nov 14
1
RCurl and cookies in POST requests
.../ml/r/cookie-20101114.cgi"
c_file <- "cookies.txt"
no_cookie <- function() {
curlHandle <- getCurlHandle(cookiefile=c_file, cookiejar=c_file)
getURL(site, curl=curlHandle)
rm(curlHandle)
gc()
}
if ( file.exists(c_file) == FALSE ) {
file.create(c_file)
no_cookie()
}
cookie_1 <- sub(".*(XXX)\t", "", grep("XXX",readLines(c_file),value=T))
if ( length(grep("ZZZ",readLines(c_file))) == 0 ) {
curlHandle <- getCurlHandle(cookiefile=c_file, cookiejar=c_file)
# Either getURL OR postForm:
aaa <- getURL(site, curl=curlHandle)...