A high-level API to automate web browsers
Project description
🎭 Playwright for Python
Playwright is a Python library to automate Chromium, Firefox and WebKit browsers with a single API. Playwright delivers automation that is ever-green, capable, reliable and fast. See how Playwright is better.
Linux | macOS | Windows | |
---|---|---|---|
Chromium 93.0.4576.0 | ✅ | ✅ | ✅ |
WebKit 14.2 | ✅ | ✅ | ✅ |
Firefox 90.0 | ✅ | ✅ | ✅ |
Documentation
https://playwright.dev/python/docs/intro
API Reference
https://playwright.dev/python/docs/api/class-playwright
Example
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
for browser_type in [p.chromium, p.firefox, p.webkit]:
browser = browser_type.launch()
page = browser.new_page()
page.goto('http://whatsmyuseragent.org/')
page.screenshot(path=f'example-{browser_type.name}.png')
browser.close()
import asyncio
from playwright.async_api import async_playwright
async def main():
async with async_playwright() as p:
for browser_type in [p.chromium, p.firefox, p.webkit]:
browser = await browser_type.launch()
page = await browser.new_page()
await page.goto('http://whatsmyuseragent.org/')
await page.screenshot(path=f'example-{browser_type.name}.png')
await browser.close()
asyncio.run(main())
Other languages
More comfortable in another programming language? Playwright is also available in
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file playwright-1.13.0-py3-none-win_amd64.whl
.
File metadata
- Download URL: playwright-1.13.0-py3-none-win_amd64.whl
- Upload date:
- Size: 15.0 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0172389160956518e76a43750b7b14504d4dd62b96f239ec517fa77a6c5d992 |
|
MD5 | f5f6ad06f8044a3d796644ec42b8f34a |
|
BLAKE2b-256 | 7e342aeed1102a56bee3a50ec5e68f3a0d6671bb8b95397a5f720fbb70610635 |
File details
Details for the file playwright-1.13.0-py3-none-win32.whl
.
File metadata
- Download URL: playwright-1.13.0-py3-none-win32.whl
- Upload date:
- Size: 13.4 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f819cb4f3f7f1edd34ec7eba58ed02923b87171c2217cfd1bbbabc7225c8d4e8 |
|
MD5 | 22a8a5bdd7820b147bd2d4c049a6871e |
|
BLAKE2b-256 | 6051d831ff40c9e4727d9fbe8a805199f3f368e7ff0c2ec605d4c6ca842871b4 |
File details
Details for the file playwright-1.13.0-py3-none-manylinux1_x86_64.whl
.
File metadata
- Download URL: playwright-1.13.0-py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 20.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05a599c6f9f695f99214b088e116cbe91b8cf3ab4d19614f69be886fa91393fc |
|
MD5 | eaf1f772143a22f0539e810bfb34e49b |
|
BLAKE2b-256 | b5085138fbe083552b80b3e61c4872c71ddea8b0db7b89f4661567db94fd7e2c |
File details
Details for the file playwright-1.13.0-py3-none-macosx_11_0_universal2.whl
.
File metadata
- Download URL: playwright-1.13.0-py3-none-macosx_11_0_universal2.whl
- Upload date:
- Size: 18.1 MB
- Tags: Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4f9d90d5f95cdd4db1968b84d73ce6c89dba793a18b7c4ca823dde27c28f899 |
|
MD5 | bc6695cc874b8fe73a90fe65fa5112dc |
|
BLAKE2b-256 | de36cf7c6efdf31eedc6d60ef241d988e9606bfeb203aca69864b4ece9c76a26 |
File details
Details for the file playwright-1.13.0-py3-none-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: playwright-1.13.0-py3-none-macosx_10_13_x86_64.whl
- Upload date:
- Size: 18.1 MB
- Tags: Python 3, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 919e1f6446839fb7763fbea19a23ddce3fb108ff13e9a3ef288cdf5a221ef9f6 |
|
MD5 | 0ffb2054889f74f22191f18ee8ca5346 |
|
BLAKE2b-256 | b78232169269dc43717e20a28108352067854ce6b55b1509b84f89548206fd78 |