Skip to content

API Reference parrot_tools.scraping.toolkit_models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.scraping.toolkit_models

View source

Toolkit data models for WebScrapingToolkit.

Provides DriverConfig (browser configuration), PlanSummary (slim registry projection), and PlanSaveResult (plan save operation result).

Attribute DEFAULT_CHROME_EXECUTABLE_PATH_KEY

Class DriverConfig

Frozen browser configuration passed to the driver factory.

Captures all browser parameters needed to create a driver instance. Use merge() to produce a new config with overrides applied.

Fields:

Field Type Default Description
driver_type Literal['selenium', 'playwright', 'obscura'] 'playwright'
browser Literal['chrome', 'firefox', 'edge', 'safari', 'undetected', 'webkit'] 'chrome'
headless bool True
mobile bool False
mobile_device Optional[str] None
auto_install bool True
default_timeout int 10
retry_attempts int 3
delay_between_actions float 1.0
overlay_housekeeping bool True
disable_images bool False
custom_user_agent Optional[str] None
user_data_dir Optional[str] None
profile_directory Optional[str] None
browser_channel Optional[str] None
browser_binary Optional[str] None
cdp_endpoint_url Optional[str] None
obscura_binary Optional[str] None
obscura_port int 9222
obscura_stealth bool False
obscura_allow_private_network bool False
record_video_dir Optional[str] None Session recording directory; consumed only by the Playwright backend.

Method DriverConfig.merge

Return a new DriverConfig with overrides applied.

The original instance is never mutated.

merge(overrides: Optional[Dict[str, Any]] = None) -> DriverConfig

Parameter Type Default Description
overrides Optional[Dict[str, Any]] None Dictionary of field names to new values. If None or empty, returns a copy of the current config.

Returns: DriverConfig — A new DriverConfig with the overrides applied.

Class PlanSaveResult

Result of a plan save operation.

Fields:

Field Type Default Description
success bool
path str
name str
version str
registered bool
message str

Class PlanSummary

Slim projection of PlanRegistryEntry for plan listing results.

Contains only the metadata needed for display and filtering, without the internal file path.

Fields:

Field Type Default Description
name str
version str
url str
domain str
created_at datetime
last_used_at Optional[datetime] None
use_count int 0
tags List[str]

Method PlanSummary.from_registry_entry

Create a PlanSummary from a PlanRegistryEntry.

from_registry_entry(entry: Any) -> PlanSummary

Parameter Type Default Description
entry Any A PlanRegistryEntry instance.

Returns: PlanSummary — A new PlanSummary with fields copied from the entry.

Attribute logger

Function resolve_browser_binary

Resolve the browser executable a driver should launch.

An explicit browser_binary always wins and is returned untouched. Otherwise, for Chrome-family browsers, the DEFAULT_CHROME_EXECUTABLE_PATH setting (environment or navconfig) is used when it points at an existing file. The default is skipped when a non-Chrome Playwright channel (e.g. "msedge") is requested, so it never hijacks another browser.

resolve_browser_binary(browser_binary: Optional[str], browser: str = 'chrome', channel: Optional[str] = None) -> Optional[str]

Parameter Type Default Description
browser_binary Optional[str] Explicitly configured executable path, if any.
browser str 'chrome' DriverConfig.browser name ("chrome", "firefox"...).
channel Optional[str] None Playwright channel, if any.

Returns: Optional[str] — The executable path to launch, or None to let the driver use its own default (bundled Chromium, channel lookup, or driver manager).

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally