I have developed several codes to clear traffic data based on this section . I need to clear many pages after logging in, but now my codes repeatedly go to the site for each URL. How can I reuse a session to avoid re-logging in so that I hope the codes can work faster? Here's the pseudo code:
generateURL <- function(siteID){return siteURL} scrapeContent <- function(siteURL, session, filled_form){return content} mainPageURL <- 'http://pems.dot.ca.gov/' pgsession <- html_session(mainPageURL) pgform <- html_form(pgsession)[[1]] filled_form <- set_value(pgform, 'username'='myUserName', 'password'='myPW') siteIDList = c(1,2,3) vectorOfContent <- vector(mode='list', length=3)
I read ruc documnentation, but there are no such details in it. My question is: how can I reuse a session to avoid re-logging in? Thank you
source share