Skip to main content
Fill a form that spans multiple pages, handling page transitions automatically.
pages_filled = await page.fill_multipage_form(
    data={"name": "John Doe", "email": "john@example.com", "address": "123 Main St"},
    max_pages=5,
)
print(f"Filled {pages_filled} pages")
ParameterTypeRequiredDescription
datadict[str, Any]YesKey-value pairs of form data to fill across all pages.
promptstrNoInstruction for the AI. Defaults to "Fill out the form".
next_buttonstrNoSelector or description of the button to advance to the next page.
max_pagesintNoMaximum number of pages to fill. Defaults to 10.
timeout_secondsfloatNoTimeout in seconds for the entire operation. Defaults to 300.
Returns int — the number of pages filled.