You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### [Docs](#documentation) | [Website](https://playwright.dev/) | [Python API reference](https://microsoft.github.io/playwright-python/)
4
4
5
-
##### [Docs](#documentation) | [Playwright API reference](https://playwright.dev/#?path=docs/api.md) | [Playwright Python API Docs](https://microsoft.github.io/playwright-python/)
6
-
7
-
Playwright is a Python library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.
5
+
Playwright is a Python library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) browsers with a single API. Playwright delivers automation that is **ever-green**, **capable**, **reliable** and **fast**. [See how Playwright is better](https://playwright.dev/#path=docs%2Fwhy-playwright.md&q=).
8
6
9
7
|| Linux | macOS | Windows |
10
8
| :--- | :---: | :---: | :---: |
@@ -14,38 +12,29 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H
14
12
15
13
Headless execution is supported for all the browsers on all platforms.
This installs Playwright and browser binaries for Chromium, Firefox and WebKit. Once installed, you can `import` Playwright in a Python script and automate web browser interactions. Playwright requires Python 3.7+.
25
-
26
-
## Capabilities
27
-
28
-
Playwright is built to automate the broad and growing set of web browser capabilities used by Single Page Apps and Progressive Web Apps.
29
-
30
-
* Scenarios that span multiple page, domains and iframes
31
-
* Auto-wait for elements to be ready before executing actions (like click, fill)
32
-
* Intercept network activity for stubbing and mocking network requests
33
-
* Emulate mobile devices, geolocation, permissions
34
-
* Support for web components via shadow-piercing selectors
35
-
* Native input events for mouse and keyboard
36
-
* Upload and download files
33
+
This installs Playwright and browser binaries for Chromium, Firefox and WebKit. Playwright requires Python 3.7+.
37
34
38
-
## Usage
39
-
40
-
### Pytest
41
-
42
-
Playwright can be used as a library in your application or as a part of the testing solution. We recommend using our [Pytest plugin](https://github.com/microsoft/playwright-pytest#readme) for testing.
35
+
Playwright offers both sync (blocking) API and async API. They are identical in terms of capabilities and only differ in how one consumes the API.
43
36
44
-
As a library, Playwright offers both blocking (synchronous) API and asyncio API (async/await). You can pick the one that works best for you. They are identical in terms of capabilities and only differ in a way one consumes the API.
45
-
46
-
Below are some of the examples on how these variations of the API can be used:
We are in the process of converting the[documentation](https://playwright.dev/) from the Node.js form to the Python one. But you can go ahead and use the Node.js documentation because the API is pretty much the same. You might have noticed that Playwright uses non-Python naming conventions, `camelCase` instead of the `snake_case` for its methods. We recognize that this is not ideal, but it was done deliberately, so that you could rely upon the stack overflow answers and the documentation of the Playwright for Node.js.
245
+
We are in the process of converting our[documentation](https://playwright.dev/) from the Node.js form to Python. You can go ahead and use the Node.js documentation since the API is pretty much the same. Playwright uses non-Python naming conventions (`camelCase` instead of `snake_case`) for its methods. We recognize that this is not ideal, but it was done deliberately, so that you could rely upon Stack Overflow answers and existing documentation.
255
246
256
-
### Understanding examples from the JavaScript documentation
247
+
### Named arguments
257
248
258
-
You can use all the same methods and arguments as [documented](https://playwright.dev/), just remember that since Python allows named arguments, we didn't need to put `options` parameter into every call as we had to in the Node.js version:
259
-
260
-
So when you see example like this in JavaScript
249
+
Since Python allows named arguments, we didn't need to put the `options` parameter into every call as in the Node.js API. So when you see example like this in JavaScript
261
250
262
251
```js
263
252
awaitwebkit.launch({ headless:false });
@@ -269,7 +258,7 @@ It translates into Python like this:
269
258
webkit.launch(headless=False)
270
259
```
271
260
272
-
If you are using an IDE, it'll suggest parameters that are available in every call.
261
+
If you are using an IDE, it will suggest parameters that are available in every call.
273
262
274
263
### Evaluating functions
275
264
@@ -340,11 +329,4 @@ with page.expect_response("**/api/fetch_data"):
340
329
341
330
Yes, Playwright for Python is ready. We are still not at the version v1.0, so minor breaking API changes could potentially happen. But a) this is unlikely and b) we will only do that if we know it improves your experience with the new library. We'd like to collect your feedback before we freeze the API for v1.0.
342
331
343
-
> Note: We don't yet support some of the edge-cases of the vendor-specific APIs such as collecting chromium trace, coverage report, etc.
0 commit comments