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

Method screenshot

playwright/_impl/_locator.py:563–582  ·  view source on GitHub ↗
(
        self,
        timeout: float = None,
        type: Literal["jpeg", "png"] = None,
        path: Union[str, pathlib.Path] = None,
        quality: int = None,
        omitBackground: bool = None,
        animations: Literal["allow", "disabled"] = None,
        caret: Literal["hide", "initial"] = None,
        scale: Literal["css", "device"] = None,
        mask: Sequence["Locator"] = None,
        maskColor: str = None,
        style: str = None,
    )

Source from the content-addressed store, hash-verified

561 return await self._frame.press(self._selector, strict=True, **params)
562
563 async def screenshot(
564 self,
565 timeout: float = None,
566 type: Literal["jpeg", "png"] = None,
567 path: Union[str, pathlib.Path] = None,
568 quality: int = None,
569 omitBackground: bool = None,
570 animations: Literal["allow", "disabled"] = None,
571 caret: Literal["hide", "initial"] = None,
572 scale: Literal["css", "device"] = None,
573 mask: Sequence["Locator"] = None,
574 maskColor: str = None,
575 style: str = None,
576 ) -> bytes:
577 params = locals_to_params(locals())
578 return await self._with_element(
579 lambda h, timeout: h.screenshot(
580 **{**params, "timeout": timeout},
581 ),
582 )
583
584 async def aria_snapshot(
585 self,

Callers

nothing calls this directly

Calls 2

_with_elementMethod · 0.95
locals_to_paramsFunction · 0.90

Tested by

no test coverage detected