Web Automation APIs
Since Playwright provides a large number of automation APIs for web automation, the official Playwright documentation is cached directly to ensure a user-friendly reading experience.
Common APIs
- BrowserType: Specify which browser to use for Web automation, optionally chromium(chrome)/firefox/webkit.
- Browser: Launches or connects to a specified browser instance.
- BrowserContext: Start or connect to a browser session in a browser instance.
- Page: Open, connect to, and manipulate a browser page, and at the same time manipulate the specified
Element
of the page by passingSelector
Handle`。 - ElementHandle: Points to a page element that can be manipulated using the methods it provides.
- Selectors selector for positioning elements, supporting a mix of selector syntax such as Playwright selector, CSS selector, XPath selector, React/Vue selector, etc. You can refer to the article Selector Guide to learn and master.
- JSHandle: A JavaScript object representing a page element that can call the methods provided by the HTMLElement standard object.
- Frame: Used to get the domain where the specified
iframe
is located in the page, can be created bypage.frame()
,elementHandle.contentFrame()
, also can be nested to callframe.childFrames()
to get the nestediframe
. - Mouse: Simulate mouse movement and click operations in the page.
- Keyboard: Simulate the operation of keyboard input keys or key combinations in the page.
All APIs can be accessedPlaywright Documentation。
You can also choose to visit PlayWright official website