Function init

Source
pub async fn init(
    browser_path: &Path,
    user_data_dir: &Path,
    headless: bool,
) -> Result<Browser>
Expand description

Starts the browser and returns a handle to it.

§Arguments

  • browser_path - The path to the browser executable (will be downloaded if not found).
  • user_data_dir - The path to the user data directory (will be created if not found).
  • headless - Whether to run the browser in headless mode.

§Errors

  • If the browser executable cannot be found or downloaded.
  • If the user data directory cannot be created.
  • If the browser cannot be launched.
  • If the browser handler cannot be spawned.