Skip to main content
Move the mouse over an element. Python only.
# Hover over a menu item
await page.hover("#menu-item")

# Hover with a hold duration
await page.hover("#tooltip-trigger", hold_seconds=1.5)

# Hover with intention logging
await page.hover("#menu-item", intention="Hover over the main menu")
ParameterTypeRequiredDescription
selectorstrYesCSS or XPath selector for the target element.
timeoutfloatNoMaximum time in milliseconds to wait for the element. Defaults to BROWSER_ACTION_TIMEOUT_MS.
hold_secondsfloatNoHow long to hold the hover, in seconds. Default 0.0.
intentionstrNoDescription of the hover intent, used for logging.
Returns str - the resolved selector used.