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.

72 lines
1.3KB

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/dsl.r, R/user-agents.R
  3. \docType{data}
  4. \name{splash_user_agent}
  5. \alias{splash_user_agent}
  6. \alias{ua_splashr}
  7. \alias{ua_win10_chrome}
  8. \alias{ua_win10_firefox}
  9. \alias{ua_win10_ie11}
  10. \alias{ua_win7_chrome}
  11. \alias{ua_win7_firefox}
  12. \alias{ua_win7_ie11}
  13. \alias{ua_macos_chrome}
  14. \alias{ua_macos_safari}
  15. \alias{ua_linux_chrome}
  16. \alias{ua_linux_firefox}
  17. \alias{ua_ios_safari}
  18. \title{Overwrite the User-Agent header for all further requests.}
  19. \format{An object of class \code{character} of length 1.}
  20. \usage{
  21. splash_user_agent(splash_obj, user_agent = ua_splashr)
  22. ua_splashr
  23. ua_win10_chrome
  24. ua_win10_firefox
  25. ua_win10_ie11
  26. ua_win7_chrome
  27. ua_win7_firefox
  28. ua_win7_ie11
  29. ua_macos_chrome
  30. ua_macos_safari
  31. ua_linux_chrome
  32. ua_linux_firefox
  33. ua_ios_safari
  34. }
  35. \arguments{
  36. \item{splash_obj}{splashr object}
  37. \item{user_agent}{1 element character vector, defaults to \code{splashr/#.#.#}.}
  38. }
  39. \description{
  40. There are a few built-in user agents, all beginning with \code{ua_}.
  41. }
  42. \examples{
  43. \dontrun{
  44. library(rvest)
  45. URL <- "https://httpbin.org/user-agent"
  46. splash_local \%>\%
  47. splash_response_body(TRUE) \%>\%
  48. splash_user_agent(ua_macos_chrome) \%>\%
  49. splash_go(URL) \%>\%
  50. splash_html() \%>\%
  51. html_text("body") \%>\%
  52. jsonlite::fromJSON()
  53. }
  54. }
  55. \concept{splash_dsl_functions_functions}
  56. \keyword{datasets}