diff --git a/R/webdriver.R b/R/webdriver.R index 28dd6a5..65c01ff 100644 --- a/R/webdriver.R +++ b/R/webdriver.R @@ -221,7 +221,7 @@ page_title <- function(){ customrequest = "GET", httpheader = c('Content-Type' = 'application/json;charset=UTF-8'), binary = T))) - + Encoding(windowTitle$value)<-"UTF-8" return(windowTitle$value) } @@ -299,9 +299,22 @@ page_source <- function(){ customrequest="GET", httpheader=c('Content-Type'='application/json;charset=UTF-8'), binary=T))) - + Encoding(source$value)<-"UTF-8" return(source$value) } +#' Retrieve cookies +#' +#' Get the current cookies +#' @export +#' @return a string containing the page cookies +get_cookies <- function(){ + cookies <- fromJSON(rawToChar(getURLContent(paste0(seleniumSession$sessionURL, "/cookie"), + customrequest = "GET", + httpheader = c('Content-Type' = 'application/json;charset=UTF-8'), + binary = T))) + + return(cookies$value) +} #' Find an element via XPath #' diff --git a/README b/README index 755bdf7..94eef4f 100644 --- a/README +++ b/README @@ -1 +1,7 @@ -R bindings to the Webdriver API \ No newline at end of file + +crubba doesn't maintain this package anymore because he/she still doesn't react about my pr. +So I'm trying to maintain Rwebdriver package. +Because easier than RSelenium. + + +R bindings to the Webdriver API