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.

as_response.Rd 773B

1234567891011121314151617181920212223242526272829303132
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/as_request.R
  3. \name{as_response}
  4. \alias{as_response}
  5. \title{Return a HAR entry response as an httr::response object}
  6. \usage{
  7. as_response(har_entry)
  8. }
  9. \arguments{
  10. \item{har_entry}{a HAR object (should contain a response body to be most useful)}
  11. }
  12. \description{
  13. Return a HAR entry response as an httr::response object
  14. }
  15. \examples{
  16. \dontrun{
  17. library(purrr)
  18. URL <- "http://www.svs.cl/portal/principal/605/w3-propertyvalue-18554.html"
  19. splash_local \%>\%
  20. splash_response_body(TRUE) \%>\%
  21. splash_user_agent(ua_macos_chrome) \%>\%
  22. splash_go(URL) \%>\%
  23. splash_wait(2) \%>\%
  24. splash_har() -> har
  25. keep(har$log$entries, is_xhr) \%>\%
  26. map(as_request) \%>\%
  27. map(httr::content, as="parsed")
  28. }
  29. }