Crate browsr_client

Crate browsr_client 

Source
Expand description

Browsr Client - HTTP client for browser automation

This crate provides a client for interacting with Browsr servers for browser automation, web scraping, and structured content extraction.

§Quick Start

use browsr_client::{BrowsrClient, BrowsrClientConfig};
use browsr_types::Commands;

// From environment variables
let client = BrowsrClient::from_env();

// Navigate to a page
let response = client.navigate("https://example.com", None).await?;

// Extract structured content
let data = client.extract_structured(
    "Extract the main heading and first paragraph",
    None,
    None,
).await?;

§Configuration

The client can be configured via environment variables or programmatically:

  • BROWSR_BASE_URL: Base URL (defaults to https://api.browsr.dev)
  • BROWSR_API_KEY: Optional API key for authentication

Structs§

BrowsrClient
Browsr HTTP client for browser automation.
BrowsrClientConfig
Configuration for the Browsr client.
ObserveOptions
Options for observing the browser state.

Enums§

ClientError
TransportConfig

Constants§

DEFAULT_BASE_URL
Default base URL for the Browsr cloud service
ENV_API_KEY
Environment variable for the API key
ENV_BASE_URL
Environment variable for the base URL

Functions§

default_base_url
Derive a default base URL for HTTP transport from standard env vars.
default_transport