Skip to main content

this_file: README.md

PlaywrightAuthor

PlaywrightAuthor gives Python Playwright scripts a persistent, authenticated Chrome for Testing browser.

It finds or installs Chrome for Testing, launches it with a persistent user profile and Chrome DevTools Protocol port, and returns a normal Playwright Browser. You log in once in the visible browser; later scripts reuse the same cookies and local browser state.

from playwrightauthor import Browser

with Browser(profile="google-primary", service="Gemini") as browser:
    page = browser.get_page()
    page.goto("https://gemini.google.com/")
    print(page.title())

Install

uv add playwrightauthor
npx @puppeteer/browsers install chrome@stable

The package uses Chrome for Testing, not a normal Chrome user profile. Multiple profiles can run at the same time because each profile receives a stable CDP debug port.

First sign-in (once per profile)

playwrightauthor run --profile google-primary --service Gemini

A visible Chrome window opens. Sign in. The session is saved to the profile directory and reused on every subsequent script run.

CLI

playwrightauthor run --profile google-primary --service Gemini
playwrightauthor run --profile google-secondary --service NotebookLM
playwrightauthor status --profile google-primary
playwrightauthor profile list
playwrightauthor profile show --name google-primary

When a browser opens for sign-in, consent, captcha, or another manual step, PlaywrightAuthor shows a small dialognano prompt describing the service, profile, and task. Suppress it from Python with suppress_dialog=True or from the CLI with --suppress-dialog.

Python API

from playwrightauthor import Browser, AsyncBrowser

with Browser(profile="work", suppress_dialog=True) as browser:
    page = browser.get_page()
    page.goto("https://github.com/")

Browser and AsyncBrowser accept profile, service, task, verbose, and suppress_dialog.

Documentation

Practical setup, CLI, profile, API, architecture, and troubleshooting guides live in docs/.

Local docs preview:

cd docs
bundle install
bundle exec jekyll serve

Development

uv run ruff check --fix src tests
uv run ruff format src tests
uvx hatch test          # runs offline in < 1 s, no Chrome needed

Run only the slow browser-integration tests (requires Chrome):

uv run pytest -m slow

Release files for playwrightauthor 1.0.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for playwrightauthor 1.0.23
File Size Uploaded
playwrightauthor-1.0.23.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for playwrightauthor 1.0.23
File Interpreter ABI Platform
playwrightauthor-1.0.23-py3-none-any.whl Python 3 none any Details

Total release size: 1.4 MB

Release files / playwrightauthor-1.0.23.tar.gz

Download URL playwrightauthor-1.0.23.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
f313b16fd1143aba7f178fc1acc4d1fe122868df9fb6c862b6012a846decd695
BLAKE2b-256 checksum
How to use checksums
89392e12c694002c17faa4b3dab9d62e458679bad8984686ee4d2e18522e59c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / playwrightauthor-1.0.23-py3-none-any.whl

Download URL playwrightauthor-1.0.23-py3-none-any.whl
Size 85.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2b96b5e60aded1c3e94aaeb5e295ee15e6b4aba5307795a3cb78b94867f74cf
BLAKE2b-256 checksum
How to use checksums
5a6b87dd625a9e4c0ceac773c7d8b0c9f6b61becf474f7ff5607e1e93e7f65ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.23 This release

2 release files

1.0.13

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page