Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Clarifying wait type and name

Matt Joyce1eacad4ef34a
diff --git a/apps/playwright-service/main.py b/apps/playwright-service/main.py
index a2a6d759f..3c1ff19e0 100644
--- a/apps/playwright-service/main.py
+++ b/apps/playwright-service/main.py
@@ -20,7 +20,7 @@ app = FastAPI()
class UrlModel(BaseModel):
"""Model representing the URL and associated parameters for the request."""
url: str
- wait: int = None
+ wait_after_load: int = 0
timeout: int = 15000
browser: Browser = None
@@ -67,8 +67,8 @@ async def root(body: UrlModel):
timeout=body.timeout,
)
# Wait != timeout. Wait is the time to wait after the page is loaded - useful in some cases were "load" / "networkidle" is not enough
- if body.wait:
- await page.wait_for_timeout(body.wait)
+ if body.wait_after_load > 0:
+ await page.wait_for_timeout(body.wait_after_load)
page_content = await page.content()
await context.close()