Переглянути джерело

replaces 'docker' with 'stevedore'; fixed minor cran checks

master
boB Rudis 5 роки тому
джерело
коміт
36b748ba81
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: 1D7529BE14E2BBA9
  1. 12
      DESCRIPTION
  2. 8
      NAMESPACE
  3. 5
      NEWS.md
  4. 21
      R/as-data-frame-har.R
  5. 48
      R/docker-splash.r
  6. 2
      R/splashr-package.R
  7. 36
      README.Rmd
  8. 27
      README.md
  9. 18
      man/as_data_frame.harentry.Rd
  10. 2
      man/as_har.Rd
  11. 2
      man/as_httr_req.Rd
  12. 2
      man/as_response.Rd
  13. 2
      man/execute_lua.Rd
  14. 2
      man/get_content_size.Rd
  15. 2
      man/get_content_type.Rd
  16. 2
      man/get_har_entry.Rd
  17. 2
      man/get_request_type.Rd
  18. 2
      man/get_request_url.Rd
  19. 2
      man/get_response_body.Rd
  20. 2
      man/har_entries.Rd
  21. 2
      man/har_entry_count.Rd
  22. 4
      man/install_splash.Rd
  23. 2
      man/json_fromb64.Rd
  24. 2
      man/killall_splash.Rd
  25. 12
      man/render_har.Rd
  26. 9
      man/render_html.Rd
  27. 13
      man/render_jpeg.Rd
  28. 17
      man/render_json.Rd
  29. 12
      man/render_png.Rd
  30. 2
      man/splash.Rd
  31. 2
      man/splash_active.Rd
  32. 2
      man/splash_add_lua.Rd
  33. 2
      man/splash_click.Rd
  34. 2
      man/splash_debug.Rd
  35. 2
      man/splash_enable_javascript.Rd
  36. 2
      man/splash_focus.Rd
  37. 2
      man/splash_go.Rd
  38. 2
      man/splash_har.Rd
  39. 2
      man/splash_har_reset.Rd
  40. 2
      man/splash_history.Rd
  41. 2
      man/splash_html.Rd
  42. 2
      man/splash_images.Rd
  43. 2
      man/splash_perf_stats.Rd
  44. 2
      man/splash_plugins.Rd
  45. 2
      man/splash_png.Rd
  46. 2
      man/splash_press.Rd
  47. 2
      man/splash_private_mode.Rd
  48. 2
      man/splash_release.Rd
  49. 2
      man/splash_response_body.Rd
  50. 2
      man/splash_send_keys.Rd
  51. 2
      man/splash_send_text.Rd
  52. 2
      man/splash_user_agent.Rd
  53. 2
      man/splash_version.Rd
  54. 2
      man/splash_wait.Rd
  55. 11
      man/start_splash.Rd
  56. 2
      man/stop_splash.Rd

12
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' <https://github.com/scrapinghub/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

8
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)

5
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

21
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

48
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()
}
}
}
}

2
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

36
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 %>%
<img src="img/flash.png" width="50%"/>
```{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)
```

27
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()

18
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)

2
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}

2
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}

2
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}

2
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.}

2
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}

2
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}

2
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}

2
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}

2
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}

2
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}

2
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}

2
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}

4
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}

2
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}

2
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}

12
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()}}}

9
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()}}}

13
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()}}}

17
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()}}}

12
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()}}}

2
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}

2
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}

2
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}

2
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.}

2
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}

2
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.}

2
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}

2
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.}

2
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.}

2
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.}

2
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}

2
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.}

2
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}

2
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}

2
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).}

2
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.}

2
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.}

2
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.}

2
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.}

2
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.}

2
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.}

2
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.}

2
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}

2
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}

2
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}

11
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

2
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}

Завантаження…
Відмінити
Зберегти