Playwright runner with persistent Chromium and one-line CLI.
Project description
easy_playwright
An ultra-simple Playwright runner that executes Python snippets while reusing a persistent Chromium session across calls.
Why ?
Traditionnal playwright MCP allow agent to call a subset of playwright functions one by one. An alternative is to allow agent to execute arbitrary python code using playwright package to freely access full API, but it general the browser is closed after each code execution.
easy_playwright allows :
- Mandatory Chromium/deps installation during pip build/install (fails fast on error)
- Auto chromium startup and persistence
- Single tool call for agent to execute any python playwright routine
- Reusing previous session accross executions
- Easy traces and screenshots captures and storage in local folder to allow human and agent monitoring
- Auto-embedding of development workflow instructions to improve agent coding autonomy
Installation
easy_playwright is designed to allow easy and light setup of playwright and chromium in same host (local dev machine or dev container)
pip install -v --no-binary easy-playwright easy-playwright (--no-binary is needed to force auto chromium installation in expected folder)
Then, add following instructions in your agent context :
Always use the ezpw tool to check your work. Run the following command, read the output carefully, and strictly follow the instructions provided.
> ezpw -h
Persistent Chromium
The browser is started automatically if not already running. The persistent profile is stored in:
.playwright/runtime/chromium-profile/
This keeps state between calls (cookies, login session, etc.).
Tip: playwright reuses the first open tab if possible, otherwise it creates a new one.
Environment variables
EASY_PLAYWRIGHT_DIR: base folder (default.playwright).EASY_PLAYWRIGHT_CDP_PORT: CDP port (default9222).EASY_PLAYWRIGHT_START_URL: URL opened on startup (defaultabout:blank).EASY_PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: if1, do not download Chromium duringpip install.
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy_playwright-0.0.4.tar.gz.
File metadata
- Download URL: easy_playwright-0.0.4.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3db4a18c419134b1405a177ca3bcfd2252848475effc1d8bea7dd205a5b62c0
|
|
| MD5 |
a6cc107fbb3e0931ac092ae36720b1ef
|
|
| BLAKE2b-256 |
80d563f666fb9a88ac7491949fdeeaeacf05f0d7121904ff47894e5172815884
|
File details
Details for the file easy_playwright-0.0.4-py3-none-any.whl.
File metadata
- Download URL: easy_playwright-0.0.4-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62625a8da640212152a835eb8e2412900c9b6dabae648cb9253b767b5d3efec3
|
|
| MD5 |
96704fb5e271a59d39affad979038b08
|
|
| BLAKE2b-256 |
e7588a039a0d4f52fc61b8ff1f8dbedde50ca14e331b040211de575e8e5ea8bd
|