Skip to main content
Click an element using a CSS selector, an AI prompt, or both. When both are given, the selector is tried first; if it fails, AI takes over.
# Standard Playwright click
await page.click("#submit-button")

# AI-powered click (no selector needed)
await page.click(prompt="Click the 'Submit' button")

# Selector with AI fallback
await page.click("#submit-button", prompt="Click the 'Submit' button")
ParameterTypeRequiredDescription
selectorstr / stringNoCSS selector for the target element.
promptstr / stringNoNatural language description of the element to click.
aistr / stringNoControls AI behavior. "fallback" (default) tries the selector first, then AI. None / null disables AI.
**kwargsNoStandard Playwright click options (e.g., timeout, force, position).
Returns str | None / string | null — the resolved selector used, or None if AI handled the click without a selector.