From c1e90631653d39b5797746c3517c3bbb56b2dcc2 Mon Sep 17 00:00:00 2001 From: a2a-cloud Date: Mon, 8 Jun 2026 22:49:08 +0000 Subject: [PATCH] write agent.py --- agent.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/agent.py b/agent.py index 08b4200..f06c9db 100644 --- a/agent.py +++ b/agent.py @@ -248,15 +248,16 @@ class SeleniumbaseWebsiteScraper(A2AAgent[SeleniumbaseWebsiteScraperConfig, NoAu grant_write_prefixes=(OUTPUT_DIR,), grant_run_timeout_seconds=900, ) - async def iterate_scrape_goal( + async def iterative_scrape_goal( self, ctx: RunContext[NoAuth], goal: str, - url: str, - selectors: dict[str, str] | None = None, - min_items: int = 10, - max_iterations: int = 5, - per_pass_max_pages: int = 1, + start_url: str, + allowed_domains: list[str] | None = None, + seed_selectors: dict[str, str] | None = None, + max_steps: int = 2, + max_pages: int = 1, + max_runtime_seconds: int = 600, wait_seconds: float = 3.0, output_format: Literal["json", "csv"] = "json", headless: bool = True, @@ -264,10 +265,9 @@ class SeleniumbaseWebsiteScraper(A2AAgent[SeleniumbaseWebsiteScraperConfig, NoAu respect_robots: bool = True, rate_limit_seconds: float = 1.0, screenshot: bool = False, - allow_selector_updates: bool = True, ) -> dict[str, Any]: """Use an LLM planner to refine selectors/pagination until the goal is met or a stop condition occurs.""" - start_url = str(url or "").strip() + start_url = str(start_url or "").strip() if not start_url: return {"status": "invalid_input", "items": [], "saved_paths": [], "warnings": ["url is required"], "screenshots": []}