Tools to Work with the 'Splash' JavaScript Rendering Service in R
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

render_png.Rd 3.2KB

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/render-png.R
  3. \name{render_png}
  4. \alias{render_png}
  5. \title{Return an image (in PNG format) of the javascript-rendered page.}
  6. \usage{
  7. render_png(splash_obj = splash_local, url, base_url = NULL, width,
  8. height, timeout = 30, resource_timeout, wait = 0,
  9. render_all = TRUE, proxy, js, js_src, filters, allowed_domains,
  10. allowed_content_types, forbidden_content_types, viewport = "full",
  11. images, headers, body, http_method, save_args, load_args)
  12. }
  13. \arguments{
  14. \item{splash_obj}{Object created by a call to \code{\link[=splash]{splash()}}}
  15. \item{url}{The URL to render (required)}
  16. \item{base_url}{The base url to render the page with.}
  17. \item{width, height}{Resize the rendered image to the given width/height (in
  18. pixels) keeping the aspect ratio. These are optional}
  19. \item{timeout}{A timeout (in seconds) for the render (defaults to 30). Without
  20. reconfiguring the startup parameters of the Splash server (not this package)
  21. the maximum allowed value for the timeout is 60 seconds.}
  22. \item{resource_timeout}{A timeout (in seconds) for individual network requests.}
  23. \item{wait}{Time (in seconds) to wait for updates after page is loaded (defaults to 0).}
  24. \item{render_all}{If \code{TRUE} extend the viewport to include the whole webpage
  25. (possibly very tall) before rendering.}
  26. \item{proxy}{Proxy profile name or proxy URL.}
  27. \item{js}{Javascript profile name.}
  28. \item{js_src}{JavaScript code to be executed in page context.}
  29. \item{filters}{Comma-separated list of request filter names.}
  30. \item{allowed_domains}{Comma-separated list of allowed domain names. If present, Splash
  31. won’t load anything neither from domains not in this list nor from subdomains of
  32. domains not in this list.}
  33. \item{allowed_content_types}{Comma-separated list of allowed content types. If present,
  34. Splash will abort any request if the response’s content type doesn’t match any of
  35. the content types in this list. Wildcards are supported.}
  36. \item{forbidden_content_types}{Comma-separated list of forbidden content types. If
  37. present, Splash will abort any request if the response’s content type matches
  38. any of the content types in this list. Wildcards are supported.}
  39. \item{viewport}{View width and height (in pixels) of the browser viewport to render the
  40. web page. Format is “<width>x<height>”, e.g. 800x600. Default value is "full".}
  41. \item{images}{Whether to download images.}
  42. \item{headers}{HTTP headers to set for the first outgoing request.}
  43. \item{body}{Body of HTTP POST request to be sent if method is POST.}
  44. \item{http_method}{HTTP method of outgoing Splash request.}
  45. \item{save_args}{A list of argument names to put in cache.}
  46. \item{load_args}{Parameter values to load from cache}
  47. }
  48. \value{
  49. a \link{magick} image object
  50. }
  51. \description{
  52. Return an image (in PNG format) of the javascript-rendered page.
  53. }
  54. \examples{
  55. \dontrun{
  56. render_png(url = "")
  57. }
  58. }
  59. \references{
  60. \href{}{Splash docs}
  61. }
  62. \seealso{
  63. Other splash_renderers: \code{\link{execute_lua}},
  64. \code{\link{render_har}}, \code{\link{render_html}},
  65. \code{\link{render_jpeg}}, \code{\link{render_json}}
  66. }
  67. \concept{splash_renderers}