splash_user_agent: Overwrite the User-Agent header for all further requests.

Description Usage Arguments Format Examples

View source: R/dsl.r

Description

There are a few built-in user agents, all beginning with ua_.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Arguments

splash_obj

splashr object

user_agent

1 element character vector, defaults to splashr/#.#.#.

Format

An object of class character of length 1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
library(rvest)

URL <- "https://httpbin.org/user-agent"

splash_local %>%
  splash_response_body(TRUE) %>%
  splash_user_agent(ua_macos_chrome) %>%
  splash_go(URL) %>%
  splash_html() %>%
  html_text("body") %>%
  jsonlite::fromJSON()

## End(Not run)

hrbrmstr/splashr documentation built on Feb. 23, 2020, 2:13 p.m.