Skip to content

API Reference parrot_tools.scraping.orchestrator

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

parrot_tools.scraping.orchestrator

View source

ScrapingOrchestrator for AI-Parrot Complete integration layer that coordinates LLM-directed web scraping

Class ScrapingMissionBuilder

Builder pattern for creating complex scraping missions

Method ScrapingMissionBuilder.add_target

Add a target to the scraping mission

add_target(url: str, objective: str = 'Extract all relevant content', authentication: Optional[Dict[str, Any]] = None, custom_steps: Optional[List[Dict[str, Any]]] = None, custom_selectors: Optional[List[Dict[str, Any]]] = None) -> ScrapingMissionBuilder

Parameter Type Default Description
url str
objective str 'Extract all relevant content'
authentication Optional[Dict[str, Any]] None
custom_steps Optional[List[Dict[str, Any]]] None
custom_selectors Optional[List[Dict[str, Any]]] None

Returns: ScrapingMissionBuilder

Method ScrapingMissionBuilder.set_rate_limiting

Set rate limiting constraints

set_rate_limiting(requests_per_minute: int = 30, delay_between_requests: float = 2.0) -> ScrapingMissionBuilder

Parameter Type Default Description
requests_per_minute int 30
delay_between_requests float 2.0

Returns: ScrapingMissionBuilder

Method ScrapingMissionBuilder.set_authentication

Set global authentication for all targets

set_authentication(username: str, password: str, login_url: str, username_selector: str = '#username', password_selector: str = '#password', submit_selector: str = 'input[type=submit]') -> ScrapingMissionBuilder

Parameter Type Default Description
username str
password str
login_url str
username_selector str '#username'
password_selector str '#password'
submit_selector str 'input[type=submit]'

Returns: ScrapingMissionBuilder

Method ScrapingMissionBuilder.enable_content_analysis

Enable advanced content analysis features

enable_content_analysis(summarize_content: bool = True, extract_entities: bool = True, sentiment_analysis: bool = False) -> ScrapingMissionBuilder

Parameter Type Default Description
summarize_content bool True
extract_entities bool True
sentiment_analysis bool False

Returns: ScrapingMissionBuilder

Method ScrapingMissionBuilder.build

Build the final mission configuration

build() -> Dict[str, Any]

Returns: Dict[str, Any]

Class ScrapingOrchestrator

High-level orchestrator that manages the complete LLM-directed scraping workflow.

This class integrates with AI-parrot's existing infrastructure:

  • Uses the knowledge base system for storing scraped content
  • Integrates with the loader system for content processing
  • Supports agent orchestration patterns
  • Provides hooks for custom post-processing
Parameter Type Default Description
agent_name str 'WebScrapingAgent'
driver_type str 'selenium'
knowledge_base Optional[KnowledgeBaseStore] None
**kwargs {}

Attributes:

Attribute Type Description
post_processors List[Callable]
result_filters List[Callable]

Method ScrapingOrchestrator.execute_scraping_mission

Execute a complete scraping mission with multiple targets and objectives.

execute_scraping_mission(mission_config: Dict[str, Any]) -> Dict[str, Any]

Parameter Type Default Description
mission_config Dict[str, Any] Configuration dictionary containing: - targets: List of URLs or site configurations - objectives: What to extract from each target - authentication: Login credentials if needed - output_config: How to store/process results - constraints: Rate limiting, ethics, etc.

Returns: Dict[str, Any] — Dictionary with complete mission results and statistics

Method ScrapingOrchestrator.add_result_filter

Add a filter function to exclude certain results

add_result_filter(filter_func: Callable[[ScrapingResult, Dict[str, Any]], bool])

Parameter Type Default Description
filter_func Callable[[ScrapingResult, Dict[str, Any]], bool]

Method ScrapingOrchestrator.add_post_processor

Add a post-processor function for result enhancement

add_post_processor(processor_func: Callable)

Parameter Type Default Description
processor_func Callable

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 WebScrapingTool

Re-exported from parrot_tools.scraping.tool.WebScrapingTool.

Function example_ecommerce_scraping

Example: Scraping product information from e-commerce sites

example_ecommerce_scraping()

Function example_news_monitoring

Example: Monitor news sites for specific topics

example_news_monitoring()

Function extract_price_number

Helper function to extract numeric price from text

extract_price_number(price_text: str) -> Optional[float]

Parameter Type Default Description
price_text str

Returns: Optional[float]

Function integrate_with_knowledge_base

Example of full integration with AI-parrot knowledge base

integrate_with_knowledge_base(kb_store: KnowledgeBaseStore)

Parameter Type Default Description
kb_store KnowledgeBaseStore

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