Skip to main content
Select an option from a dropdown using a CSS selector, an AI prompt, or both.
# Standard Playwright select
await page.select_option("#country", value="us")

# AI-powered select
await page.select_option(prompt="Select 'United States' from the country dropdown")

# Selector with AI fallback
await page.select_option("#country", value="us",
    prompt="Select United States from country")
ParameterTypeRequiredDescription
selectorstr / stringNoCSS selector for the <select> element.
valuestr / stringNoThe option value to select.
promptstr / stringNoNatural language description of the dropdown and the option to select.
aistr / stringNoControls AI behavior. "fallback" (default) tries the selector first, then AI. None / null disables AI.
**kwargsNoStandard Playwright select options (e.g., timeout, force).
Returns list[str] / string[] — the selected option values.