@@ -12254,6 +12254,49 @@ async def remove_locator_handler(self, locator: "Locator") -> None:
1225412254 await self._impl_obj.remove_locator_handler(locator=locator._impl_obj)
1225512255 )
1225612256
12257+ async def requests(self) -> typing.List["Request"]:
12258+ """Page.requests
12259+
12260+ Returns up to (currently) 100 last network request from this page. See `page.on('request')` for more details.
12261+
12262+ Returned requests should be accessed immediately, otherwise they might be collected to prevent unbounded memory
12263+ growth as new requests come in. Once collected, retrieving most information about the request is impossible.
12264+
12265+ Note that requests reported through the `page.on('request')` request are not collected, so there is a trade off
12266+ between efficient memory usage with `page.requests()` and the amount of available information reported
12267+ through `page.on('request')`.
12268+
12269+ Returns
12270+ -------
12271+ List[Request]
12272+ """
12273+
12274+ return mapping.from_impl_list(await self._impl_obj.requests())
12275+
12276+ async def console_messages(self) -> typing.List["ConsoleMessage"]:
12277+ """Page.console_messages
12278+
12279+ Returns up to (currently) 200 last console messages from this page. See `page.on('console')` for more details.
12280+
12281+ Returns
12282+ -------
12283+ List[ConsoleMessage]
12284+ """
12285+
12286+ return mapping.from_impl_list(await self._impl_obj.console_messages())
12287+
12288+ async def page_errors(self) -> typing.List["Error"]:
12289+ """Page.page_errors
12290+
12291+ Returns up to (currently) 200 last page errors from this page. See `page.on('page_error')` for more details.
12292+
12293+ Returns
12294+ -------
12295+ List[Error]
12296+ """
12297+
12298+ return mapping.from_impl_list(await self._impl_obj.page_errors())
12299+
1225712300
1225812301mapping.register(PageImpl, Page)
1225912302
@@ -12297,13 +12340,7 @@ def on(
1229712340 f: typing.Callable[["Page"], "typing.Union[typing.Awaitable[None], None]"],
1229812341 ) -> None:
1229912342 """
12300- **NOTE** Only works with Chromium browser's persistent context.
12301-
12302- Emitted when new background page is created in the context.
12303-
12304- ```py
12305- background_page = await context.wait_for_event(\"backgroundpage\")
12306- ```"""
12343+ This event is not emitted."""
1230712344
1230812345 @typing.overload
1230912346 def on(
@@ -12477,13 +12514,7 @@ def once(
1247712514 f: typing.Callable[["Page"], "typing.Union[typing.Awaitable[None], None]"],
1247812515 ) -> None:
1247912516 """
12480- **NOTE** Only works with Chromium browser's persistent context.
12481-
12482- Emitted when new background page is created in the context.
12483-
12484- ```py
12485- background_page = await context.wait_for_event(\"backgroundpage\")
12486- ```"""
12517+ This event is not emitted."""
1248712518
1248812519 @typing.overload
1248912520 def once(
@@ -12679,9 +12710,7 @@ def browser(self) -> typing.Optional["Browser"]:
1267912710 def background_pages(self) -> typing.List["Page"]:
1268012711 """BrowserContext.background_pages
1268112712
12682- **NOTE** Background pages are only supported on Chromium-based browsers.
12683-
12684- All existing background pages in the context.
12713+ Returns an empty list.
1268512714
1268612715 Returns
1268712716 -------
@@ -16617,7 +16646,7 @@ def and_(self, locator: "Locator") -> "Locator":
1661716646 The following example finds a button with a specific title.
1661816647
1661916648 ```py
16620- button = page.get_by_role(\"button\").and_(page.getByTitle (\"Subscribe\"))
16649+ button = page.get_by_role(\"button\").and_(page.get_by_title (\"Subscribe\"))
1662116650 ```
1662216651
1662316652 Parameters
0 commit comments