|
| typing.Dict | devices (self) |
| |
| "Selectors" | selectors (self) |
| |
| "BrowserType" | chromium (self) |
| |
| "BrowserType" | firefox (self) |
| |
| "BrowserType" | webkit (self) |
| |
| "APIRequest" | request (self) |
| |
|
"BrowserType" | __getitem__ (self, str value) |
| |
| None | stop (self) |
| |
| None | __init__ (self, Any impl_obj) |
| |
|
str | __str__ (self) |
| |
| None | on (self, Any event, Any f) |
| |
| None | once (self, Any event, Any f) |
| |
| None | remove_listener (self, Any event, Any f) |
| |
|
str | __repr__ (self) |
| |
|
|
Callable[..., None] | _wrap_handler (self, Union[Callable[..., Any], Any] handler) |
| |
|
| _loop |
| |
|
| _impl_obj |
| |
◆ chromium()
| "BrowserType" playwright.async_api._generated.Playwright.chromium |
( |
|
self | ) |
|
Playwright.chromium
This object can be used to launch or connect to Chromium, returning instances of `Browser`.
Returns
-------
BrowserType
◆ devices()
| typing.Dict playwright.async_api._generated.Playwright.devices |
( |
|
self | ) |
|
Playwright.devices
Returns a dictionary of devices to be used with `browser.new_context()` or `browser.new_page()`.
```py
import asyncio
from playwright.async_api import async_playwright, Playwright
async def run(playwright: Playwright):
webkit = playwright.webkit
iphone = playwright.devices[\"iPhone 6\"]
browser = await webkit.launch()
context = await browser.new_context(**iphone)
page = await context.new_page()
await page.goto(\"http://example.com\")
# other actions...
await browser.close()
async def main():
async with async_playwright() as playwright:
await run(playwright)
asyncio.run(main())
```
Returns
-------
Dict
◆ firefox()
| "BrowserType" playwright.async_api._generated.Playwright.firefox |
( |
|
self | ) |
|
Playwright.firefox
This object can be used to launch or connect to Firefox, returning instances of `Browser`.
Returns
-------
BrowserType
◆ request()
| "APIRequest" playwright.async_api._generated.Playwright.request |
( |
|
self | ) |
|
Playwright.request
Exposes API that can be used for the Web API testing.
Returns
-------
APIRequest
◆ selectors()
| "Selectors" playwright.async_api._generated.Playwright.selectors |
( |
|
self | ) |
|
Playwright.selectors
Selectors can be used to install custom selector engines. See [extensibility](https://playwright.dev/python/docs/extensibility) for more
information.
Returns
-------
Selectors
◆ stop()
| None playwright.async_api._generated.Playwright.stop |
( |
|
self | ) |
|
Playwright.stop
Terminates this instance of Playwright in case it was created bypassing the Python context manager. This is useful
in REPL applications.
```py
from playwright.sync_api import sync_playwright
playwright = sync_playwright().start()
browser = playwright.chromium.launch()
page = browser.new_page()
page.goto(\"https://playwright.dev/\")
page.screenshot(path=\"example.png\")
browser.close()
playwright.stop()
```
◆ webkit()
| "BrowserType" playwright.async_api._generated.Playwright.webkit |
( |
|
self | ) |
|
Playwright.webkit
This object can be used to launch or connect to WebKit, returning instances of `Browser`.
Returns
-------
BrowserType
The documentation for this class was generated from the following file:
- docs/help/help-venv/lib/python3.12/site-packages/playwright/async_api/_generated.py