Skip to main content
Fill an input with autocomplete/typeahead handling.
await page.fill_autocomplete(
    selector="#city",
    value="San Francisco",
    option_selector=".autocomplete-option",
)

Parameters

ParameterTypeRequiredDescription
selectorstrNoCSS selector for the input field.
valuestrNoThe text value to type into the field.
promptstrNoNatural language description of the field and value.
aistrNoControls AI behavior. "fallback" (default) tries the selector first, then AI.
option_selectorstrNoCSS selector for the autocomplete dropdown options.
wait_secondsfloatNoSeconds to wait for the dropdown to appear. Default 1.5.
**kwargsNoStandard Playwright fill options (e.g., timeout, force).

Returns str

The resolved selector used.