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)
| File | Size | Uploaded | |
|---|---|---|---|
| playwrightauthor-1.0.23.tar.gz | 1.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| playwrightauthor-1.0.23-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.4 MB