Skip to content

API Reference parrot_tools.scraping.executor

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

parrot_tools.scraping.executor

View source

Step Executor — standalone scraping plan execution.

Extracts the step-execution pipeline from WebScrapingTool._execute into a reusable async function. Both WebScrapingToolkit.scrape() and CrawlEngine can share this execution logic without duplication.

All driver interactions use the AbstractDriver interface exclusively; no Selenium-specific imports live in this module.

Alias AbstractDriver

Re-exported from parrot_tools.scraping.drivers.abstract.AbstractDriver.

Alias CredentialResolverFn

Re-exported from parrot_tools.scraping.session_actions.CredentialResolverFn.

Alias DriverConfig

Re-exported from parrot_tools.scraping.toolkit_models.DriverConfig.

Attribute MAX_SCREENSHOT_BASE64_BYTES

Maximum raw PNG bytes included as base64 in extracted data.

Type: int

Alias ScrapingPlan

Re-exported from parrot_tools.scraping.plan.ScrapingPlan.

Alias ScrapingResult

Re-exported from parrot_tools.scraping.models.ScrapingResult.

Alias ScrapingSelector

Re-exported from parrot_tools.scraping.models.ScrapingSelector.

Alias ScrapingStep

Re-exported from parrot_tools.scraping.models.ScrapingStep.

Alias check_navigation

Re-exported from parrot_tools.scraping.confine.check_navigation.

Alias confined_file

Re-exported from parrot_tools.scraping.confine.confined_file.

Alias exec_authenticate

Re-exported from parrot_tools.scraping.session_actions.exec_authenticate.

Alias exec_await_browser_event

Re-exported from parrot_tools.scraping.session_actions.exec_await_browser_event.

Alias exec_await_human

Re-exported from parrot_tools.scraping.session_actions.exec_await_human.

Alias exec_await_keypress

Re-exported from parrot_tools.scraping.session_actions.exec_await_keypress.

Alias exec_conditional

Re-exported from parrot_tools.scraping.advanced_actions.exec_conditional.

Alias exec_get_cookies

Re-exported from parrot_tools.scraping.session_actions.exec_get_cookies.

Alias exec_loop

Re-exported from parrot_tools.scraping.advanced_actions.exec_loop.

Alias exec_set_cookies

Re-exported from parrot_tools.scraping.session_actions.exec_set_cookies.

Alias exec_upload_file

Re-exported from parrot_tools.scraping.session_actions.exec_upload_file.

Alias exec_wait_for_download

Re-exported from parrot_tools.scraping.session_actions.exec_wait_for_download.

Function execute_plan_steps

Execute a scraping plan's steps against a browser driver.

Accepts either a full ScrapingPlan or a raw steps list for ad-hoc usage. Steps are executed sequentially; selectors are applied after all steps complete.

execute_plan_steps(driver: AbstractDriver, plan: Optional[ScrapingPlan] = None, steps: Optional[List[Dict[str, Any]]] = None, selectors: Optional[List[Dict[str, Any]]] = None, config: Optional[DriverConfig] = None, base_url: Optional[str] = None, credential_resolver: Optional[CredentialResolverFn] = None, channel: Optional['HumanChannel'] = None) -> ScrapingResult

Parameter Type Default Description
driver AbstractDriver Browser driver instance implementing AbstractDriver.
plan Optional[ScrapingPlan] None Full ScrapingPlan (takes priority if provided).
steps Optional[List[Dict[str, Any]]] None Raw steps list for ad-hoc usage (used when plan is None).
selectors Optional[List[Dict[str, Any]]] None Content extraction selectors (used when plan is None).
config Optional[DriverConfig] None Driver configuration for delay/timeout settings.
base_url Optional[str] None Fallback base URL for relative link resolution.
credential_resolver Optional[CredentialResolverFn] None Optional resolver forwarded to every authenticate step's :func:~.session_actions.exec_authenticate (Decision D2/G3 — broker-backed credentials, never literal fields, when Authenticate.credential_provider is set).
channel Optional['HumanChannel'] None Optional :class:HumanChannel forwarded to every await_human step's :func:~.session_actions.exec_await_human, so a mid-plan pause actually reaches a person instead of silently defaulting to channel=None (fail-closed on condition_type="manual").

Returns: ScrapingResult — ScrapingResult with extracted data and metadata.

Attribute logger

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