Learn R Programming

decapitated (version 0.1.0)

chrome_shot: Capture a screenshot

Description

For the moment, the capture file is in the current working directory and named screenshot.png. This will change, soon.

Usage

chrome_shot(url, width = NULL, height = NULL, path = NULL,
  overwrite = TRUE, chrome_bin = Sys.getenv("HEADLESS_CHROME"))

Arguments

url

URL to read from

width, height

screen size to emulate

path

path (with optional output filename) for the generated PDF. If NULL then and overwrite is FALSE, the fuction will will ensure a uniquely-named file is placed in the current working directory by incrementing trailing numbers before the end of it.

overwrite

overwrite existing file? Default: TRUE

chrome_bin

the path to Chrome (auto-set from HEADLESS_CHROME environment variable)

Value

magick

Details

A magick image object is returned.

Examples

Run this code
# NOT RUN {
chrome_shot("https://www.r-project.org/logo/Rlogo.svg")
# }

Run the code above in your browser using DataLab