# Basic options objects
chrome_options(
binary = "/path/to/chrome",
args = c("--headless", "--disable-gpu"),
detatch = TRUE, # An additional option described in the link above.
prefs = list(
"profile.default_content_setting_values.notifications" = 2
)
)
firefox_options(binary = "/path/to/firefox")
edge_options(binary = "/path/to/edge")
# Setting the user agent
chrome_options(args = c("--user-agent=My User Agent"))
edge_options(args = c("--user-agent=My User Agent"))
firefox_options(prefs = list(
"general.useragent.override" = "My User Agent"
))
# Using a proxy server
chrome_options(args = c("--proxy-server=HOST:PORT"))
edge_options(args = c("--proxy-server=HOST:PORT"))
PORT <- 1
firefox_options(prefs = list(
"network.proxy.type" = 1,
"network.proxy.socks" = "HOST",
"network.proxy.socks_port" = PORT,
"network.proxy.socks_remote_dns" = FALSE
))
# Combining with other options
browser_options <- chrome_options(binary = "/path/to/chrome")
c(browser_options, list(platformName = "Windows"))
Run the code above in your browser using DataLab