Skip to main content

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 --break-system-packages

(--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 (default 9222).
  • EASY_PLAYWRIGHT_START_URL: URL opened on startup (default about:blank).
  • EASY_PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: if 1, do not download Chromium during pip install.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easy_playwright-0.0.5.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_playwright-0.0.5-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file easy_playwright-0.0.5.tar.gz.

File metadata

  • Download URL: easy_playwright-0.0.5.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for easy_playwright-0.0.5.tar.gz
Algorithm Hash digest
SHA256 c2322f903bde7d1e7f9f3f7b9b60ef4431146384c924403e863e573d11712433
MD5 0b327bf1fb6430c806fce1847441295c
BLAKE2b-256 42d7b11d54cd9a33e7cf66dec2c9475e8bc710beb57912d493394a11cebb59d5

See more details on using hashes here.

File details

Details for the file easy_playwright-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for easy_playwright-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dfc6719b6802d00f062b13a9420252df91a9ff904fb1103c6690d28b829e660f
MD5 ff789ba95c51670fc7ea1306bd565dfb
BLAKE2b-256 6701dd2f007a0898a4fdaad36fae9120795d29d3078b77c1a50ad1032cc57f2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page