MCPcopy Index your code
hub / github.com/microsoft/playwright-python / hover

Method hover

playwright/async_api/_generated.py:11849–11916  ·  view source on GitHub ↗

Page.hover This method hovers over an element matching `selector` by performing the following steps: 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM. 1. Wait for [actionability](https://playwright.dev/python/docs

(
        self,
        selector: str,
        *,
        modifiers: typing.Optional[
            typing.Sequence[Literal["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]]
        ] = None,
        position: typing.Optional[Position] = None,
        timeout: typing.Optional[typing.Union[float, datetime.timedelta]] = None,
        no_wait_after: typing.Optional[bool] = None,
        force: typing.Optional[bool] = None,
        strict: typing.Optional[bool] = None,
        trial: typing.Optional[bool] = None,
    )

Source from the content-addressed store, hash-verified

11847 )
11848
11849 async def hover(
11850 self,
11851 selector: str,
11852 *,
11853 modifiers: typing.Optional[
11854 typing.Sequence[Literal["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]]
11855 ] = None,
11856 position: typing.Optional[Position] = None,
11857 timeout: typing.Optional[typing.Union[float, datetime.timedelta]] = None,
11858 no_wait_after: typing.Optional[bool] = None,
11859 force: typing.Optional[bool] = None,
11860 strict: typing.Optional[bool] = None,
11861 trial: typing.Optional[bool] = None,
11862 ) -> None:
11863 """Page.hover
11864
11865 This method hovers over an element matching `selector` by performing the following steps:
11866 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
11867 1. Wait for [actionability](https://playwright.dev/python/docs/actionability) checks on the matched element, unless `force` option is set. If
11868 the element is detached during the checks, the whole action is retried.
11869 1. Scroll the element into view if needed.
11870 1. Use `page.mouse` to hover over the center of the element, or the specified `position`.
11871
11872 When all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.
11873 Passing zero timeout disables this.
11874
11875 Parameters
11876 ----------
11877 selector : str
11878 A selector to search for an element. If there are multiple elements satisfying the selector, the first will be
11879 used.
11880 modifiers : Union[Sequence[Union["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]], None]
11881 Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
11882 current modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to
11883 "Control" on Windows and Linux and to "Meta" on macOS.
11884 position : Union[{x: float, y: float}, None]
11885 A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
11886 the element.
11887 timeout : Union[float, None]
11888 Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can
11889 be changed by using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.
11890 no_wait_after : Union[bool, None]
11891 This option has no effect.
11892 Deprecated: This option has no effect.
11893 force : Union[bool, None]
11894 Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
11895 strict : Union[bool, None]
11896 When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
11897 element, the call throws an exception.
11898 trial : Union[bool, None]
11899 When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults
11900 to `false`. Useful to wait until the element is ready for the action without performing it. Note that keyboard
11901 `modifiers` will be pressed regardless of `trial` to allow testing elements which are only visible when those keys
11902 are pressed.
11903 """
11904
11905 return mapping.from_maybe_impl(
11906 await self._impl_obj.hover(

Callers 3

hoverMethod · 0.45
hoverMethod · 0.45
hoverMethod · 0.45

Calls 3

to_millisecondsFunction · 0.90
from_maybe_implMethod · 0.80
to_implMethod · 0.80

Tested by

no test coverage detected