diff --git a/DESCRIPTION b/DESCRIPTION index ce1e7b2..6a18104 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: splashr Type: Package Title: Tools to Work with the 'Splash' 'JavaScript' Rendering and Scraping Service -Version: 0.5.0 -Date: 2018-08-13 +Version: 0.6.0 +Date: 2019-01-13 Encoding: UTF-8 Authors@R: c( person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"), @@ -16,8 +16,8 @@ Description: 'Splash' is a 'JavaScript' multiple web pages in parallel; retrieving 'HTML' results and/or take screen shots; disabling images or use 'Adblock Plus' rules to make rendering faster; executing custom 'JavaScript' in page context; getting detailed rendering info in 'HAR' format. -URL: http://github.com/hrbrmstr/splashr -BugReports: https://github.com/hrbrmstr/splashr/issues +URL: http://gitlab.com/hrbrmstr/splashr +BugReports: https://gitlab.com/hrbrmstr/splashr/issues License: AGPL Suggests: testthat, @@ -37,7 +37,7 @@ Imports: purrr, stats, utils, - docker, + stevedore, magick, scales, formatR, @@ -46,5 +46,5 @@ Imports: HARtools, jsonlite, lubridate -RoxygenNote: 6.0.1.9000 +RoxygenNote: 6.1.1 VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 67fb0ca..827beec 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,14 +3,14 @@ S3method(as.data.frame,har) S3method(as.data.frame,harentries) S3method(as.data.frame,harentry) -S3method(as_data_frame,har) -S3method(as_data_frame,harentries) -S3method(as_data_frame,harentry) S3method(print,splash_debug) S3method(print,splash_json) export("%>%") export(HARviewer) export(HARviewerOutput) +export(as_data_frame.har) +export(as_data_frame.harentries) +export(as_data_frame.harentry) export(as_har) export(as_httr_req) export(as_response) @@ -90,10 +90,10 @@ export(ua_win7_chrome) export(ua_win7_firefox) export(ua_win7_ie11) export(writeHAR) -import(docker) import(httr) import(magick) import(purrr) +import(stevedore) importFrom(HARtools,HARviewer) importFrom(HARtools,HARviewerOutput) importFrom(HARtools,renderHARviewer) diff --git a/NEWS.md b/NEWS.md index 5aa8b0b..cd62508 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +0.6.0 + +* Switch Docker orchestration to the `stevedore` package +* Fixed minor check on as.data.frame functions + 0.5.0 * support Splash API basic auth diff --git a/R/as-data-frame-har.R b/R/as-data-frame-har.R index cc44741..6f70ba2 100644 --- a/R/as-data-frame-har.R +++ b/R/as-data-frame-har.R @@ -1,13 +1,14 @@ #' Turns a "HAR"-like object into a data frame(tibble) #' #' @md -#' @param harentry_obj A `harentry` object +#' @param x A `harentry` object +#' @param ... ignored #' @return data frame (tibble) #' @export -as_data_frame.harentry <- function(harentry_obj) { +as_data_frame.harentry <- function(x, ...) { - req <- harentry_obj$request - resp <- harentry_obj$response + req <- x$request + resp <- x$response data_frame( request_url = req$url, @@ -35,20 +36,16 @@ as_data_frame.harentry <- function(harentry_obj) { } -#' @md -#' @param harentries_obj A `harentry` object #' @rdname as_data_frame.harentry #' @export -as_data_frame.harentries <- function(harentries_obj) { - map_df(harentries_obj, as_data_frame) +as_data_frame.harentries <- function(x, ...) { + map_df(x, as_data_frame) } -#' @md -#' @param har_obj A `har` object #' @rdname as_data_frame.harentry #' @export -as_data_frame.har <- function(har_obj) { - as_data_frame(har_obj$log$entries) +as_data_frame.har <- function(x, ...) { + as_data_frame(x$log$entries) } #' @export diff --git a/R/docker-splash.r b/R/docker-splash.r index eaab1b4..184eb17 100644 --- a/R/docker-splash.r +++ b/R/docker-splash.r @@ -9,11 +9,9 @@ #' splash_container <- start_splash() #' stop_splash(splash_container) #' } -install_splash <- function(tag="3.0") { - client <- docker::docker$from_env() - res <- client$api$pull("scrapinghub/splash", tag) - res <- jsonlite::stream_in(textConnection(res), verbose=FALSE) - invisible(lapply(res$status, function(x) { message(x) })) +install_splash <- function(tag="3.2") { + docker <- stevedore::docker_client() + res <- docker$image$pull("scrapinghub/splash", tag=tag, stream=stdout()) } #' Start a Splash server Docker container @@ -26,22 +24,29 @@ install_splash <- function(tag="3.0") { #' [install_splash] for this to work. You should save the resultant #' object for use in [stop_splash] otherwise you'll have to kill it from the #' command line interface. +#' @param container_name naem for the container. Defaults to "`splashr`". +#' @param remove remove the Splash container instance after it's stopped? +#' Defaults to `FALSE`. #' @family splash_docker_helpers -#' @return `docker` `container` object +#' @return `stevedor` container object #' @export #' @examples \dontrun{ #' install_splash() #' splash_container <- start_splash() #' stop_splash(splash_container) #' } -start_splash <- function(tag="3.0") { +start_splash <- function(tag="3.2", container_name = "splashr", remove=FALSE) { - client <- docker::docker$from_env() + docker <- stevedore::docker_client() - splash_inst <- client$containers$run( - sprintf("scrapinghub/splash:%s", tag), name="splashr", - detach=TRUE, ports=list('8050/tcp'='8050', '5023/tcp'='5023', '8051/tcp'='8051') - ) + docker$container$run( + image = sprintf("scrapinghub/splash:%s", tag), + name = container_name, + ports = c("5023:5023", "8051:8051"), + detach = TRUE, + rm = remove, + tty = TRUE + ) -> splash_inst invisible(splash_inst) @@ -63,6 +68,7 @@ start_splash <- function(tag="3.0") { stop_splash <- function(splash_container) { splash_container$stop() splash_container$remove() + invisible(NULL) } #' Prune all dead and running Splash Docker containers @@ -76,14 +82,16 @@ stop_splash <- function(splash_container) { #' @export killall_splash <- function() { - client <- docker::docker$from_env() - x <- client$containers$list(all = TRUE) - - for (cntnr in x) { - if (grepl("scrapinghub/splash", cntnr$image$tags[1])) { - message(sprintf("Pruning: %s...", cntnr$id)) - if (cntnr$status == "running") cntnr$stop() - cntnr$remove() + docker <- stevedore::docker_client() + x <- docker$container$list(all=TRUE) + for (i in 1:nrow(x)) { + if (grepl("bin/splash", x$command[i])) { + message(sprintf("Pruning: %s...", x$id[i])) + if (x$state[i] == "running") { + cntnr <- docker$container$get(x$id[i]) + cntnr$stop() + cntnr$remove() + } } } } diff --git a/R/splashr-package.R b/R/splashr-package.R index 1d6bea8..61dcbe4 100644 --- a/R/splashr-package.R +++ b/R/splashr-package.R @@ -14,7 +14,7 @@ #' @name splashr #' @docType package #' @author Bob Rudis (bob@@rud.is) -#' @import purrr httr magick docker +#' @import purrr httr magick stevedore #' @importFrom stringi stri_split_regex stri_split_fixed stri_detect_regex stri_split_lines #' @importFrom HARtools writeHAR HARviewer renderHARviewer HARviewerOutput #' @importFrom xml2 read_html url_parse diff --git a/README.Rmd b/README.Rmd index 486a523..67610a3 100644 --- a/README.Rmd +++ b/README.Rmd @@ -6,15 +6,15 @@ output: rmarkdown::github_document [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/splashr)](https://cran.r-project.org/package=splashr) [![](http://cranlogs.r-pkg.org/badges/splashr)](http://cran.rstudio.com/web/packages/splashr/index.html) -`splashr` : Tools to Work with the 'Splash' JavaScript Rendering Service +# `splashr` : Tools to Work with the 'Splash' JavaScript Rendering Service TL;DR: This package works with Splash rendering servers which are really just a REST API & `lua` scripting interface to a QT browser. It's an alternative to the Selenium ecosystem which was really engineered for application testing & validation. Sometimes, all you need is a page scrape after javascript has been allowed to roam wild and free over meticulously crafted HTML tags. So, this package does not do _everything_ Selenium can in pure R (though, the Lua interface is equally as powerful and accessible via R), but if you're just trying to get a page back that needs javascript rendering, this is a nice, lightweight, consistent alternative. -It's also an alternative to `phantomjs` (which you can use in R within or without a Selenium context as it's it's own webdriver) and it may be useful to compare renderings between this package & `phantomjs`. +It's also an alternative to the somewhat abandoned `phantomjs` (which you can use in R within or without a Selenium context as it's it's own webdriver) and it may be useful to compare renderings between this package & `phantomjs`. -You can also get it running with two commands: +The package uses the [`stevedore`](https://github.com/richfitz/stevedore) package to orchestrate Docker on your system (if you have Docker and more on how to use the `stevedore` integration below) but you can also do get it running in Docker on the command-line with two commands: sudo docker pull scrapinghub/splash:3.0 sudo docker run -p 5023:5023 -p 8050:8050 -p 8051:8051 scrapinghub/splash:3.0 @@ -28,7 +28,7 @@ Folks super-new to Docker on Unix-ish platforms should [make sure to do](https:/ (`$USER` is your username and shld be defined for you in the environment) -If using the [`docker`](https://github.com/bhaskarvk/docker) package you can use the convience wrappers in this pacakge: +If using the [`stevedore`](https://github.com/richfitz/stevedore) package you can use the convience wrappers in this pacakge: install_splash() splash_container <- start_splash() @@ -119,12 +119,14 @@ Suggest more in a feature req! ### Installation ```{r eval=FALSE} +devtools::install_git("https://sr.ht/~hrbrmstr/splashr.git") +# or devtools::install_git("https://gitlab.com/hrbrmstr/splashr.git") # or devtools::install_github("hrbrmstr/splashr") ``` -```{r message=FALSE, warning=FALSE, error=FALSE} +```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE} options(width=120) ``` @@ -223,30 +225,6 @@ splash_local %>% -```{r echo=FALSE, eval=FALSE} -library(htmlwidgets) -library(DiagrammeR) - - ### Rendering Widgets - {r eval=FALSE} - splash_vm <- start_splash(add_tempdir = TRUE) - -DiagrammeR(" - graph LR - A-->B - A-->C - C-->E - B-->D - C-->D - D-->F - E-->F -") %>% - saveWidget("/tmp/diag.html") - -render_file(url = "/tmp/diag.html", output="html") -![](img/diag.png) -``` - ```{r eval=FALSE} stop_splash(splash_vm) ``` diff --git a/README.md b/README.md index 25263db..c256c63 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ [![Travis-CI Build Status](https://travis-ci.org/hrbrmstr/splashr.svg?branch=master)](https://travis-ci.org/hrbrmstr/splashr) [![Coverage Status](https://img.shields.io/codecov/c/github/hrbrmstr/splashr/master.svg)](https://codecov.io/github/hrbrmstr/splashr?branch=master) [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/splashr)](https://cran.r-project.org/package=splashr) [![](http://cranlogs.r-pkg.org/badges/splashr)](http://cran.rstudio.com/web/packages/splashr/index.html) -`splashr` : Tools to Work with the 'Splash' JavaScript Rendering Service +# `splashr` : Tools to Work with the 'Splash' JavaScript Rendering Service TL;DR: This package works with Splash rendering servers which are really just a REST API & `lua` scripting interface to a QT browser. It's an alternative to the Selenium ecosystem which was really engineered for application testing & validation. Sometimes, all you need is a page scrape after javascript has been allowed to roam wild and free over meticulously crafted HTML tags. So, this package does not do *everything* Selenium can in pure R (though, the Lua interface is equally as powerful and accessible via R), but if you're just trying to get a page back that needs javascript rendering, this is a nice, lightweight, consistent alternative. -It's also an alternative to `phantomjs` (which you can use in R within or without a Selenium context as it's it's own webdriver) and it may be useful to compare renderings between this package & `phantomjs`. +It's also an alternative to the somewhat abandoned `phantomjs` (which you can use in R within or without a Selenium context as it's it's own webdriver) and it may be useful to compare renderings between this package & `phantomjs`. -You can also get it running with two commands: +The package uses the [`stevedore`](https://github.com/richfitz/stevedore) package to orchestrate Docker on your system (if you have Docker and more on how to use the `stevedore` integration below) but you can also do get it running in Docker on the command-line with two commands: sudo docker pull scrapinghub/splash:3.0 sudo docker run -p 5023:5023 -p 8050:8050 -p 8051:8051 scrapinghub/splash:3.0 - -Do whatever you Windows ppl do with Docker on your systems to make ^^ work. + +Do whatever you Windows ppl do with Docker on your systems to make ^^ work. Folks super-new to Docker on Unix-ish platforms should [make sure to do](https://github.com/hrbrmstr/splashr/issues/3#issuecomment-280686494): @@ -23,7 +23,7 @@ Folks super-new to Docker on Unix-ish platforms should [make sure to do](https:/ (`$USER` is your username and shld be defined for you in the environment) -If using the [`docker`](https://github.com/bhaskarvk/docker) package you can use the convience wrappers in this pacakge: +If using the [`stevedore`](https://github.com/richfitz/stevedore) package you can use the convience wrappers in this pacakge: install_splash() splash_container <- start_splash() @@ -31,7 +31,7 @@ If using the [`docker`](https://github.com/bhaskarvk/docker) package you can use and then run: stop_splash(splash_container) - + when done. All of that happens on your localhost and you will not need to specify `splash_obj` to many of the `splashr` functions if you're running Splash in this default configuration as long as you use named parameters. You can also use the pre-defined `splash_local` object if you want to use positional parameters. Now, you can run Selenium in Docker, so this is not unique to Splash. But, a Docker context makes it so that you don't have to run or maintain icky Python stuff directly on your system. Leave it in the abandoned warehouse district where it belongs. @@ -114,12 +114,11 @@ Suggest more in a feature req! ### Installation ``` r -devtools::install_github("hrbrmstr/splashr") -``` - -``` r -options(width=120) -``` +devtools::install_git("https://sr.ht/~hrbrmstr/splashr.git") +# or +devtools::install_git("https://gitlab.com/hrbrmstr/splashr.git") +# or +devtools::install_github("hrbrmstr/splashr")``` ### Usage @@ -136,7 +135,7 @@ library(tidyverse) packageVersion("splashr") ``` - ## [1] '0.4.0' + ## [1] '0.6.0' ``` r splash_active() diff --git a/man/as_data_frame.harentry.Rd b/man/as_data_frame.harentry.Rd index 2ad3155..65554c1 100644 --- a/man/as_data_frame.harentry.Rd +++ b/man/as_data_frame.harentry.Rd @@ -9,24 +9,22 @@ \alias{as.data.frame.harentry} \title{Turns a "HAR"-like object into a data frame(tibble)} \usage{ -\method{as_data_frame}{harentry}(harentry_obj) +as_data_frame.harentry(x, ...) -\method{as_data_frame}{harentries}(harentries_obj) +as_data_frame.harentries(x, ...) -\method{as_data_frame}{har}(har_obj) +as_data_frame.har(x, ...) -\method{as.data.frame}{har}(har_obj) +\method{as.data.frame}{har}(x, ...) -\method{as.data.frame}{harentries}(harentries_obj) +\method{as.data.frame}{harentries}(x, ...) -\method{as.data.frame}{harentry}(harentry_obj) +\method{as.data.frame}{harentry}(x, ...) } \arguments{ -\item{harentry_obj}{A \code{harentry} object} +\item{x}{A \code{harentry} object} -\item{harentries_obj}{A \code{harentry} object} - -\item{har_obj}{A \code{har} object} +\item{...}{ignored} } \value{ data frame (tibble) diff --git a/man/as_har.Rd b/man/as_har.Rd index 866d2bc..46dc461 100644 --- a/man/as_har.Rd +++ b/man/as_har.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/render-har.r +% Please edit documentation in R/render-har.R \name{as_har} \alias{as_har} \title{Turn a generic Splash HAR response into a HAR object} diff --git a/man/as_httr_req.Rd b/man/as_httr_req.Rd index 2b1a7a0..1e8fb45 100644 --- a/man/as_httr_req.Rd +++ b/man/as_httr_req.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/as_req.r +% Please edit documentation in R/as_req.R \name{as_httr_req} \alias{as_httr_req} \title{Create an httr verb request function from an HAR request} diff --git a/man/as_response.Rd b/man/as_response.Rd index 37bf656..322b086 100644 --- a/man/as_response.Rd +++ b/man/as_response.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/as_request.r +% Please edit documentation in R/as_request.R \name{as_response} \alias{as_response} \title{Return a HAR entry response as an httr::response object} diff --git a/man/execute_lua.Rd b/man/execute_lua.Rd index 1b50b40..21d2972 100644 --- a/man/execute_lua.Rd +++ b/man/execute_lua.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/execute.r +% Please edit documentation in R/execute.R \name{execute_lua} \alias{execute_lua} \title{Execute a custom rendering script and return a result.} diff --git a/man/get_content_size.Rd b/man/get_content_size.Rd index 7a0c151..a87931b 100644 --- a/man/get_content_size.Rd +++ b/man/get_content_size.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/content.r +% Please edit documentation in R/content.R \name{get_content_size} \alias{get_content_size} \alias{get_body_size} diff --git a/man/get_content_type.Rd b/man/get_content_type.Rd index 0e3bbab..573eb21 100644 --- a/man/get_content_type.Rd +++ b/man/get_content_type.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/helpers.r +% Please edit documentation in R/helpers.R \name{get_content_type} \alias{get_content_type} \alias{is_content_type} diff --git a/man/get_har_entry.Rd b/man/get_har_entry.Rd index 4311cdf..b1664c1 100644 --- a/man/get_har_entry.Rd +++ b/man/get_har_entry.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/helpers.r +% Please edit documentation in R/helpers.R \name{get_har_entry} \alias{get_har_entry} \title{Retrieve an entry by index from a HAR object} diff --git a/man/get_request_type.Rd b/man/get_request_type.Rd index ade7b01..556a347 100644 --- a/man/get_request_type.Rd +++ b/man/get_request_type.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/helpers.r +% Please edit documentation in R/helpers.R \name{get_request_type} \alias{get_request_type} \alias{is_get} diff --git a/man/get_request_url.Rd b/man/get_request_url.Rd index ce17ffe..5d1a0a1 100644 --- a/man/get_request_url.Rd +++ b/man/get_request_url.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/helpers.r +% Please edit documentation in R/helpers.R \name{get_request_url} \alias{get_request_url} \title{Retrieve request URL} diff --git a/man/get_response_body.Rd b/man/get_response_body.Rd index 2542102..859217c 100644 --- a/man/get_response_body.Rd +++ b/man/get_response_body.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/helpers.r +% Please edit documentation in R/helpers.R \name{get_response_body} \alias{get_response_body} \title{Retrieve the body content of a HAR entry} diff --git a/man/har_entries.Rd b/man/har_entries.Rd index b5969f9..bac527b 100644 --- a/man/har_entries.Rd +++ b/man/har_entries.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/helpers.r +% Please edit documentation in R/helpers.R \name{har_entries} \alias{har_entries} \title{Retrieve just the HAR entries from a splashr request} diff --git a/man/har_entry_count.Rd b/man/har_entry_count.Rd index 1ab8ef1..af46d44 100644 --- a/man/har_entry_count.Rd +++ b/man/har_entry_count.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/helpers.r +% Please edit documentation in R/helpers.R \name{har_entry_count} \alias{har_entry_count} \title{Retrieves number of HAR entries in a response} diff --git a/man/install_splash.Rd b/man/install_splash.Rd index 22938a3..f865f1f 100644 --- a/man/install_splash.Rd +++ b/man/install_splash.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/docker-splash.r +% Please edit documentation in R/docker-splash.R \name{install_splash} \alias{install_splash} \title{Retrieve the Docker image for Splash} \usage{ -install_splash(tag = "3.0") +install_splash(tag = "3.2") } \arguments{ \item{tag}{Splash Docker image tag to install} diff --git a/man/json_fromb64.Rd b/man/json_fromb64.Rd index dbc2a91..ae280bd 100644 --- a/man/json_fromb64.Rd +++ b/man/json_fromb64.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils.r +% Please edit documentation in R/utils.R \name{json_fromb64} \alias{json_fromb64} \title{Convert a Base64 encoded string into an R object} diff --git a/man/killall_splash.Rd b/man/killall_splash.Rd index 832d5db..ee89a51 100644 --- a/man/killall_splash.Rd +++ b/man/killall_splash.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/docker-splash.r +% Please edit documentation in R/docker-splash.R \name{killall_splash} \alias{killall_splash} \title{Prune all dead and running Splash Docker containers} diff --git a/man/render_har.Rd b/man/render_har.Rd index 02abd1f..93b3b61 100644 --- a/man/render_har.Rd +++ b/man/render_har.Rd @@ -1,14 +1,14 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/render-har.r +% Please edit documentation in R/render-har.R \name{render_har} \alias{render_har} \title{Return information about Splash interaction with a website in HAR format.} \usage{ -render_har(splash_obj = splash_local, url, base_url, response_body = FALSE, - timeout = 30, resource_timeout, wait = 0, proxy, js, js_src, filters, - allowed_domains, allowed_content_types, forbidden_content_types, - viewport = "1024x768", images, headers, body, http_method, save_args, - load_args) +render_har(splash_obj = splash_local, url, base_url, + response_body = FALSE, timeout = 30, resource_timeout, wait = 0, + proxy, js, js_src, filters, allowed_domains, allowed_content_types, + forbidden_content_types, viewport = "1024x768", images, headers, body, + http_method, save_args, load_args) } \arguments{ \item{splash_obj}{Object created by a call to \code{\link[=splash]{splash()}}} diff --git a/man/render_html.Rd b/man/render_html.Rd index 4025b0d..8012666 100644 --- a/man/render_html.Rd +++ b/man/render_html.Rd @@ -1,13 +1,14 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/render-html.r +% Please edit documentation in R/render-html.R \name{render_html} \alias{render_html} \title{Return the HTML of the javascript-rendered page.} \usage{ render_html(splash_obj = splash_local, url, base_url, timeout = 30, - resource_timeout, wait = 0, proxy, js, js_src, filters, allowed_domains, - allowed_content_types, forbidden_content_types, viewport = "1024x768", - images, headers, body, http_method, save_args, load_args, raw_html = FALSE) + resource_timeout, wait = 0, proxy, js, js_src, filters, + allowed_domains, allowed_content_types, forbidden_content_types, + viewport = "1024x768", images, headers, body, http_method, save_args, + load_args, raw_html = FALSE) } \arguments{ \item{splash_obj}{Object created by a call to \code{\link[=splash]{splash()}}} diff --git a/man/render_jpeg.Rd b/man/render_jpeg.Rd index b5d0b3f..6924dff 100644 --- a/man/render_jpeg.Rd +++ b/man/render_jpeg.Rd @@ -1,14 +1,15 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/render-jpg.r +% Please edit documentation in R/render-jpg.R \name{render_jpeg} \alias{render_jpeg} \title{Return a image (in JPEG format) of the javascript-rendered page.} \usage{ -render_jpeg(splash_obj = splash_local, url, base_url = NULL, quality = 75, - width, height, timeout = 30, resource_timeout, wait = 0, - render_all = TRUE, proxy, js, js_src, filters, allowed_domains, - allowed_content_types, forbidden_content_types, viewport = "full", images, - headers, body, http_method, save_args, load_args) +render_jpeg(splash_obj = splash_local, url, base_url = NULL, + quality = 75, width, height, timeout = 30, resource_timeout, + wait = 0, render_all = TRUE, proxy, js, js_src, filters, + allowed_domains, allowed_content_types, forbidden_content_types, + viewport = "full", images, headers, body, http_method, save_args, + load_args) } \arguments{ \item{splash_obj}{Object created by a call to \code{\link[=splash]{splash()}}} diff --git a/man/render_json.Rd b/man/render_json.Rd index ea55df2..26c02fb 100644 --- a/man/render_json.Rd +++ b/man/render_json.Rd @@ -1,16 +1,17 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/render-json.r +% Please edit documentation in R/render-json.R \name{render_json} \alias{render_json} \title{Return a json-encoded dictionary with information about javascript-rendered webpage.} \usage{ -render_json(splash_obj = splash_local, url, base_url = NULL, quality = 75, - width, height, timeout = 30, resource_timeout, wait = 0, - render_all = FALSE, proxy, js, js_src, filters, allowed_domains, - allowed_content_types, forbidden_content_types, viewport = "1024x768", - images, headers, body, http_method, save_args, load_args, html = TRUE, - png = FALSE, jpeg = FALSE, iframes = TRUE, script = TRUE, - console = TRUE, history = TRUE, har = TRUE, response_body = FALSE) +render_json(splash_obj = splash_local, url, base_url = NULL, + quality = 75, width, height, timeout = 30, resource_timeout, + wait = 0, render_all = FALSE, proxy, js, js_src, filters, + allowed_domains, allowed_content_types, forbidden_content_types, + viewport = "1024x768", images, headers, body, http_method, save_args, + load_args, html = TRUE, png = FALSE, jpeg = FALSE, + iframes = TRUE, script = TRUE, console = TRUE, history = TRUE, + har = TRUE, response_body = FALSE) } \arguments{ \item{splash_obj}{Object created by a call to \code{\link[=splash]{splash()}}} diff --git a/man/render_png.Rd b/man/render_png.Rd index 8c0b209..ec746f6 100644 --- a/man/render_png.Rd +++ b/man/render_png.Rd @@ -1,14 +1,14 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/render-png.r +% Please edit documentation in R/render-png.R \name{render_png} \alias{render_png} \title{Return an image (in PNG format) of the javascript-rendered page.} \usage{ -render_png(splash_obj = splash_local, url, base_url = NULL, width, height, - timeout = 30, resource_timeout, wait = 0, render_all = TRUE, proxy, js, - js_src, filters, allowed_domains, allowed_content_types, - forbidden_content_types, viewport = "full", images, headers, body, - http_method, save_args, load_args) +render_png(splash_obj = splash_local, url, base_url = NULL, width, + height, timeout = 30, resource_timeout, wait = 0, + render_all = TRUE, proxy, js, js_src, filters, allowed_domains, + allowed_content_types, forbidden_content_types, viewport = "full", + images, headers, body, http_method, save_args, load_args) } \arguments{ \item{splash_obj}{Object created by a call to \code{\link[=splash]{splash()}}} diff --git a/man/splash.Rd b/man/splash.Rd index 9c271be..fd47fb4 100644 --- a/man/splash.Rd +++ b/man/splash.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/splashr.r +% Please edit documentation in R/splashr.R \docType{data} \name{splash} \alias{splash} diff --git a/man/splash_active.Rd b/man/splash_active.Rd index 95e7ab7..5c64313 100644 --- a/man/splash_active.Rd +++ b/man/splash_active.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/splashr.r +% Please edit documentation in R/splashr.R \name{splash_active} \alias{splash_active} \title{Test if a Splash server is up} diff --git a/man/splash_add_lua.Rd b/man/splash_add_lua.Rd index f8d9c7d..ac57c03 100644 --- a/man/splash_add_lua.Rd +++ b/man/splash_add_lua.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_add_lua} \alias{splash_add_lua} \title{Add raw lua code into DSL call chain} diff --git a/man/splash_click.Rd b/man/splash_click.Rd index c1eed58..2ee197d 100644 --- a/man/splash_click.Rd +++ b/man/splash_click.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_click} \alias{splash_click} \title{Trigger mouse click event in web page.} diff --git a/man/splash_debug.Rd b/man/splash_debug.Rd index 1e55fde..5a9ed78 100644 --- a/man/splash_debug.Rd +++ b/man/splash_debug.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/splashr.r +% Please edit documentation in R/splashr.R \name{splash_debug} \alias{splash_debug} \alias{print.splash_debug} diff --git a/man/splash_enable_javascript.Rd b/man/splash_enable_javascript.Rd index 4c54bd3..d359c7c 100644 --- a/man/splash_enable_javascript.Rd +++ b/man/splash_enable_javascript.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_enable_javascript} \alias{splash_enable_javascript} \title{Enable or disable execution of JavaSript code embedded in the page.} diff --git a/man/splash_focus.Rd b/man/splash_focus.Rd index 49ad75d..b31891c 100644 --- a/man/splash_focus.Rd +++ b/man/splash_focus.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_focus} \alias{splash_focus} \title{Focus on a document element provided by a CSS selector} diff --git a/man/splash_go.Rd b/man/splash_go.Rd index ec52ee5..f0c7698 100644 --- a/man/splash_go.Rd +++ b/man/splash_go.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_go} \alias{splash_go} \title{Go to an URL.} diff --git a/man/splash_har.Rd b/man/splash_har.Rd index 7b82ec3..b771ab3 100644 --- a/man/splash_har.Rd +++ b/man/splash_har.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_har} \alias{splash_har} \title{Return information about Splash interaction with a website in HAR format.} diff --git a/man/splash_har_reset.Rd b/man/splash_har_reset.Rd index f98551c..1ed9eaf 100644 --- a/man/splash_har_reset.Rd +++ b/man/splash_har_reset.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_har_reset} \alias{splash_har_reset} \title{Drops all internally stored HAR records.} diff --git a/man/splash_history.Rd b/man/splash_history.Rd index 7e87566..d328c52 100644 --- a/man/splash_history.Rd +++ b/man/splash_history.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/splashr.r +% Please edit documentation in R/splashr.R \name{splash_history} \alias{splash_history} \title{Get information about requests/responses for the pages loaded} diff --git a/man/splash_html.Rd b/man/splash_html.Rd index 9888cb0..cbe9427 100644 --- a/man/splash_html.Rd +++ b/man/splash_html.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_html} \alias{splash_html} \title{Return a HTML snapshot of a current page.} diff --git a/man/splash_images.Rd b/man/splash_images.Rd index 7a15144..1268b30 100644 --- a/man/splash_images.Rd +++ b/man/splash_images.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_images} \alias{splash_images} \title{Enable/disable images} diff --git a/man/splash_perf_stats.Rd b/man/splash_perf_stats.Rd index b43213a..1067c17 100644 --- a/man/splash_perf_stats.Rd +++ b/man/splash_perf_stats.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/splashr.r +% Please edit documentation in R/splashr.R \name{splash_perf_stats} \alias{splash_perf_stats} \title{Get Splash performance-related statistics} diff --git a/man/splash_plugins.Rd b/man/splash_plugins.Rd index 13f814f..f7df3d0 100644 --- a/man/splash_plugins.Rd +++ b/man/splash_plugins.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_plugins} \alias{splash_plugins} \title{Enable or disable browser plugins (e.g. Flash).} diff --git a/man/splash_png.Rd b/man/splash_png.Rd index 5a50a92..a20cfdb 100644 --- a/man/splash_png.Rd +++ b/man/splash_png.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_png} \alias{splash_png} \title{Return a screenshot of a current page in PNG format.} diff --git a/man/splash_press.Rd b/man/splash_press.Rd index ce4f99d..3b506d8 100644 --- a/man/splash_press.Rd +++ b/man/splash_press.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_press} \alias{splash_press} \title{Trigger mouse press event in web page.} diff --git a/man/splash_private_mode.Rd b/man/splash_private_mode.Rd index 6e33cc8..36a0c8b 100644 --- a/man/splash_private_mode.Rd +++ b/man/splash_private_mode.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_private_mode} \alias{splash_private_mode} \title{Enable or disable execution of JavaSript code embedded in the page.} diff --git a/man/splash_release.Rd b/man/splash_release.Rd index 50d38f0..39a8651 100644 --- a/man/splash_release.Rd +++ b/man/splash_release.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_release} \alias{splash_release} \title{Trigger mouse release event in web page.} diff --git a/man/splash_response_body.Rd b/man/splash_response_body.Rd index 300a6bc..9f2753d 100644 --- a/man/splash_response_body.Rd +++ b/man/splash_response_body.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_response_body} \alias{splash_response_body} \title{Enable or disable response content tracking.} diff --git a/man/splash_send_keys.Rd b/man/splash_send_keys.Rd index 9e0e6e9..b1ceda9 100644 --- a/man/splash_send_keys.Rd +++ b/man/splash_send_keys.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_send_keys} \alias{splash_send_keys} \title{Send keyboard events to page context.} diff --git a/man/splash_send_text.Rd b/man/splash_send_text.Rd index b912c83..412ad95 100644 --- a/man/splash_send_text.Rd +++ b/man/splash_send_text.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_send_text} \alias{splash_send_text} \title{Send text as input to page context, literally, character by character.} diff --git a/man/splash_user_agent.Rd b/man/splash_user_agent.Rd index 215129b..f73bdce 100644 --- a/man/splash_user_agent.Rd +++ b/man/splash_user_agent.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r, R/user-agents.R +% Please edit documentation in R/dsl.R, R/user-agents.R \docType{data} \name{splash_user_agent} \alias{splash_user_agent} diff --git a/man/splash_version.Rd b/man/splash_version.Rd index 509b0d3..13960cb 100644 --- a/man/splash_version.Rd +++ b/man/splash_version.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/splashr.r +% Please edit documentation in R/splashr.R \name{splash_version} \alias{splash_version} \title{Get Splash version information} diff --git a/man/splash_wait.Rd b/man/splash_wait.Rd index 53df349..6fa1180 100644 --- a/man/splash_wait.Rd +++ b/man/splash_wait.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dsl.r +% Please edit documentation in R/dsl.R \name{splash_wait} \alias{splash_wait} \title{Wait for a period time} diff --git a/man/start_splash.Rd b/man/start_splash.Rd index d13e9f1..e8ae152 100644 --- a/man/start_splash.Rd +++ b/man/start_splash.Rd @@ -1,16 +1,21 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/docker-splash.r +% Please edit documentation in R/docker-splash.R \name{start_splash} \alias{start_splash} \title{Start a Splash server Docker container} \usage{ -start_splash(tag = "3.0") +start_splash(tag = "3.2", container_name = "splashr", remove = FALSE) } \arguments{ \item{tag}{Splash Docker image tag to start} + +\item{container_name}{naem for the container. Defaults to "`splashr`".} + +\item{remove}{remove the Splash container instance after it's stopped? +Defaults to `FALSE`.} } \value{ -`docker` `container` object +`stevedor` container object } \description{ If using this in an automation context, you should consider adding a diff --git a/man/stop_splash.Rd b/man/stop_splash.Rd index b867fe9..30d1403 100644 --- a/man/stop_splash.Rd +++ b/man/stop_splash.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/docker-splash.r +% Please edit documentation in R/docker-splash.R \name{stop_splash} \alias{stop_splash} \title{Stop a running a Splash server Docker container}