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

Download files

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

Source Distribution

playwrightauthor-1.0.23.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

playwrightauthor-1.0.23-py3-none-any.whl (85.4 kB view details)

Uploaded Python 3

File details

Details for the file playwrightauthor-1.0.23.tar.gz.

File metadata

  • Download URL: playwrightauthor-1.0.23.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for playwrightauthor-1.0.23.tar.gz
Algorithm Hash digest
SHA256 f313b16fd1143aba7f178fc1acc4d1fe122868df9fb6c862b6012a846decd695
MD5 68d833df7c841b3c26421eedb29beaec
BLAKE2b-256 89392e12c694002c17faa4b3dab9d62e458679bad8984686ee4d2e18522e59c9

See more details on using hashes here.

File details

Details for the file playwrightauthor-1.0.23-py3-none-any.whl.

File metadata

  • Download URL: playwrightauthor-1.0.23-py3-none-any.whl
  • Upload date:
  • Size: 85.4 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for playwrightauthor-1.0.23-py3-none-any.whl
Algorithm Hash digest
SHA256 a2b96b5e60aded1c3e94aaeb5e295ee15e6b4aba5307795a3cb78b94867f74cf
MD5 0ff4b022513bb98ec215b54d8619ea76
BLAKE2b-256 5a6b87dd625a9e4c0ceac773c7d8b0c9f6b61becf474f7ff5607e1e93e7f65ce

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 Sentry Error logging StatusPage Status page