4646 PageLoadTimeout ,
4747 WaitElementTimeout ,
4848)
49- from pydoll .protocol .base import EmptyResponse
49+ from pydoll .protocol .base import EmptyResponse , Response
5050from pydoll .protocol .browser .events import (
5151 BrowserEvent ,
5252 DownloadProgressEvent ,
@@ -282,7 +282,7 @@ async def enable_fetch_events(
282282 Note:
283283 Intercepted requests must be explicitly continued or timeout.
284284 """
285- response : EmptyResponse = await self ._execute_command (
285+ response : Response [ EmptyResponse ] = await self ._execute_command (
286286 FetchCommands .enable (
287287 handle_auth_requests = handle_auth ,
288288 resource_type = resource_type ,
@@ -424,6 +424,10 @@ async def get_frame(self, frame: WebElement) -> IFrame:
424424
425425 return Tab (self ._browser , self ._connection_port , iframe_target ['targetId' ])
426426
427+ async def bring_to_front (self ):
428+ """Brings the page to front."""
429+ return await self ._execute_command (PageCommands .bring_to_front ())
430+
427431 async def get_cookies (self ) -> list [Cookie ]:
428432 """Get all cookies accessible from current page."""
429433 response : GetCookiesResponse = await self ._execute_command (
@@ -545,6 +549,7 @@ async def take_screenshot(
545549 self ,
546550 path : Optional [str ] = None ,
547551 quality : int = 100 ,
552+ beyond_viewport : bool = False ,
548553 as_base64 : bool = False ,
549554 ) -> Optional [str ]:
550555 """
@@ -553,6 +558,8 @@ async def take_screenshot(
553558 Args:
554559 path: File path for screenshot (extension determines format).
555560 quality: Image quality 0-100 (default 100).
561+ beyond_viewport: The page will be scrolled to the bottom and the screenshot will
562+ include the entire page
556563 as_base64: Return as base64 string instead of saving file.
557564
558565 Returns:
@@ -573,6 +580,7 @@ async def take_screenshot(
573580 PageCommands .capture_screenshot (
574581 format = ScreenshotFormat .get_value (output_extension ),
575582 quality = quality ,
583+ capture_beyond_viewport = beyond_viewport ,
576584 )
577585 )
578586 screenshot_data = response ['result' ]['data' ]
0 commit comments