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.

121 lines

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/render-json.r
  3. \name{render_json}
  4. \alias{render_json}
  5. \title{Return a json-encoded dictionary with information about javascript-rendered webpage.}
  6. \usage{
  7. render_json(splash_obj = splash_local, url, base_url = NULL, quality = 75,
  8. width, height, timeout = 30, resource_timeout, wait = 0,
  9. render_all = FALSE, proxy, js, js_src, filters, allowed_domains,
  10. allowed_content_types, forbidden_content_types, viewport = "1024x768",
  11. images, headers, body, http_method, save_args, load_args, html = TRUE,
  12. png = FALSE, jpeg = FALSE, iframes = TRUE, script = TRUE,
  13. console = TRUE, history = TRUE, har = TRUE, response_body = FALSE)
  14. }
  15. \arguments{
  16. \item{splash_obj}{Object created by a call to \code{\link[=splash]{splash()}}}
  17. \item{url}{The URL to render (required)}
  18. \item{base_url}{The base url to render the page with.}
  19. \item{quality}{JPEG quality parameter in range from 0 to 100. Default is quality=75.}
  20. \item{width}{Resize the rendered image to the given width/height (in
  21. pixels) keeping the aspect ratio. These are optional}
  22. \item{height}{Resize the rendered image to the given width/height (in
  23. pixels) keeping the aspect ratio. These are optional}
  24. \item{timeout}{A timeout (in seconds) for the render (defaults to 30). Without
  25. reconfiguring the startup parameters of the Splash server (not this package)
  26. the maximum allowed value for the timeout is 60 seconds.}
  27. \item{resource_timeout}{A timeout (in seconds) for individual network requests.}
  28. \item{wait}{Time (in seconds) to wait for updates after page is loaded (defaults to 0).}
  29. \item{render_all}{If \code{TRUE} extend the viewport to include the whole webpage
  30. (possibly very tall) before rendering.}
  31. \item{proxy}{Proxy profile name or proxy URL.}
  32. \item{js}{Javascript profile name.}
  33. \item{js_src}{JavaScript code to be executed in page context.}
  34. \item{filters}{Comma-separated list of request filter names.}
  35. \item{allowed_domains}{Comma-separated list of allowed domain names. If present, Splash
  36. won’t load anything neither from domains not in this list nor from subdomains of
  37. domains not in this list.}
  38. \item{allowed_content_types}{Comma-separated list of allowed content types. If present,
  39. Splash will abort any request if the response’s content type doesn’t match any of
  40. the content types in this list. Wildcards are supported.}
  41. \item{forbidden_content_types}{Comma-separated list of forbidden content types. If
  42. present, Splash will abort any request if the response’s content type matches
  43. any of the content types in this list. Wildcards are supported.}
  44. \item{viewport}{View width and height (in pixels) of the browser viewport to render the
  45. web page. Format is “<width>x<height>”, e.g. 800x600. Default value is "full".}
  46. \item{images}{Whether to download images.}
  47. \item{headers}{HTTP headers to set for the first outgoing request.}
  48. \item{body}{Body of HTTP POST request to be sent if method is POST.}
  49. \item{http_method}{HTTP method of outgoing Splash request.}
  50. \item{save_args}{A list of argument names to put in cache.}
  51. \item{load_args}{Parameter values to load from cache}
  52. \item{html}{Whether to include HTML in output.}
  53. \item{png}{Whether to include PNG in output.}
  54. \item{jpeg}{Whether to include JPEG in output.}
  55. \item{iframes}{Whether to include information about child frames in output.}
  56. \item{script}{Whether to include the result of the custom executed javascript final
  57. statement in output}
  58. \item{console}{Whether to include the executed javascript console messages in output.}
  59. \item{history}{Whether to include the history of requests/responses for webpage main frame.
  60. Use it to get HTTP status codes and headers. Only information about "main"
  61. requests/responses is returned (i.e. information about related resources
  62. like images and AJAX queries is not returned). To get information about all
  63. requests and responses use \code{har} parameter.}
  64. \item{har}{Whether to include HAR in output. If \code{TRUE} the result will contain the same
  65. data as \code{\link[=render_har]{render_har()}} provides under \code{har} list entry. By default, response
  66. content is not included. To enable it use \code{response_body} parameter.}
  67. \item{response_body}{Used with \code{har} parameter.}
  68. }
  69. \value{
  70. a huge \code{list}
  71. }
  72. \description{
  73. It can include HTML, PNG and other information, based on arguments passed.
  74. }
  75. \note{
  76. All "whether to include..." parameters are default \code{TRUE} except for \code{png} and
  77. \code{jpeg} and a custom \code{print} method is defined to stop your console from being
  78. overwhelmed with data. Use \code{\link[=str]{str()}} to inspect various portions of the result.
  79. }
  80. \references{
  81. \href{}{Splash docs}
  82. }
  83. \seealso{
  84. Other splash_renderers: \code{\link{execute_lua}},
  85. \code{\link{render_har}}, \code{\link{render_html}},
  86. \code{\link{render_jpeg}}, \code{\link{render_png}}
  87. }
  88. \concept{splash_renderers}