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 107.0.5304.18 | ✅ | ✅ | ✅ |
WebKit 16.0 | ✅ | ✅ | ✅ |
Firefox 105.0.1 | ✅ | ✅ | ✅ |
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.27.0-py3-none-win_amd64.whl
.
File metadata
- Download URL: playwright-1.27.0-py3-none-win_amd64.whl
- Upload date:
- Size: 27.4 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cbeab451099cf0d52d9e80baf970363f900c8cc85ecf4d7dcde76a86c47880a |
|
MD5 | e37425f4ad19c782d8c629223f7cc9fa |
|
BLAKE2b-256 | 8708f5db4cf495472c9398d93728d9069d89668606402eaa01fd98ef4bc884e1 |
File details
Details for the file playwright-1.27.0-py3-none-win32.whl
.
File metadata
- Download URL: playwright-1.27.0-py3-none-win32.whl
- Upload date:
- Size: 27.4 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe90b890061f729d2ea2f547fc5b316a5e6361e3659fbc639ee35e08be38d13f |
|
MD5 | f99efd4181d506e28c00093ef31442d3 |
|
BLAKE2b-256 | f3d9a28ec2afb467b7f93300a925132f917d3c7d5f0fb1ebada10073728c9167 |
File details
Details for the file playwright-1.27.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: playwright-1.27.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 33.1 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bb56b53fa10aaedb32c28eef06a0579244c2ccf3ddf9238fb09044bfb6c493e |
|
MD5 | 8239af821a2d77028c0d75a7ead354d1 |
|
BLAKE2b-256 | b94d0f8eace98a0214e87dae4ae1d7160891dc6c67f352f19ad34fb1205676a6 |
File details
Details for the file playwright-1.27.0-py3-none-manylinux1_x86_64.whl
.
File metadata
- Download URL: playwright-1.27.0-py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 33.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c0bd4af19ea145cd3aa4f9f1009e4e4b0ffd05a78235c5338a35e83366e68b5 |
|
MD5 | b7e84b6304b0dabcddddb3ba26427e1f |
|
BLAKE2b-256 | 57dbcf470ae438ae6607fdb9958faab739bbf1411ede8d0664914e401f690622 |
File details
Details for the file playwright-1.27.0-py3-none-macosx_11_0_universal2.whl
.
File metadata
- Download URL: playwright-1.27.0-py3-none-macosx_11_0_universal2.whl
- Upload date:
- Size: 30.9 MB
- Tags: Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c0989016156539f58286831c4ff200260f2173e4026330697e257aa7609f7eb |
|
MD5 | 6afc60a40f256d08e1dd840f61d0c133 |
|
BLAKE2b-256 | 08578aac4dafed1887106769304e392dd08278c8e2dff484c6bf5b68bfb49f4b |
File details
Details for the file playwright-1.27.0-py3-none-macosx_11_0_arm64.whl
.
File metadata
- Download URL: playwright-1.27.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 29.4 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5ae41c4313af04b9deb2b2cf6c1ebeb9deb1fa66149d8026ce48a45cbaaeb08 |
|
MD5 | 4e9f8f9462c83916a56e164f4f3e57cd |
|
BLAKE2b-256 | 24aebd552d84daaa970789ee174dbaa245f1e2546c37a7492ae7df9fd7a02118 |
File details
Details for the file playwright-1.27.0-py3-none-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: playwright-1.27.0-py3-none-macosx_10_13_x86_64.whl
- Upload date:
- Size: 30.9 MB
- Tags: Python 3, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd1ebac1e261eb58b393f9f504c223b0129dda3a19a41bba47c86abbd1301ca7 |
|
MD5 | 34235504c592a54fec836dd7c0e87363 |
|
BLAKE2b-256 | e76bde22f71dc836cf3ddcff8f1a65420ff06d64de5d8a3b6504992d436e3446 |