browser_launch: Launches a Playwright browser instance

View source: R/browser.R

browser_launchR Documentation

Launches a Playwright browser instance

Description

This function launches a Playwright browser instance and returns a tibble containing the ID of the browser. The browser instance can be used to create new browser contexts and perform various actions.

Usage

browser_launch(
  browser = c("chromium", "firefox", "webkit"),
  headless = TRUE,
  timeout = 30000,
  user_data_dir = NULL,
  channel = NULL,
  user_agent = NULL
)

Arguments

headless

Whether to run the browser in headless mode. Default is TRUE.

timeout

Maximum time in milliseconds to wait for the browser instance to start. Default is 30000 (30 seconds). Pass 0 to disable timeout.

executable_path

Path to a browser executable to run instead of the bundled one. If NULL, the bundled browser will be used. Default is NULL.

args

Additional arguments to pass to the browser instance. Default is NULL.

proxy

Proxy settings for all requests. Default is NULL.

slow_mo

Slows down Playwright operations by the specified amount of milliseconds. Useful for debugging. Default is NULL.

Value

A tibble containing the ID of the launched browser.

Examples

browser <- browser_launch()


benjaminguinaudeau/playwrightr documentation built on Nov. 8, 2023, 8:36 p.m.