Skip to main content

playwright-byob

PyPI version Python versions CI tests Mypy check Ruff check Documentation License

Bring your own browser to Playwright.

playwright-byob is a tiny Python helper for launching Playwright against the real Google Chrome installation and profile already present on a machine. It keeps the API close to Playwright, but chooses practical defaults for headed, persistent Chrome automation.

Installation

pip install playwright-byob

With uv:

uv add playwright-byob

Quick start

from playwright.sync_api import sync_playwright
from playwright_byob import launch_chrome

with sync_playwright() as p:
    context = launch_chrome(p)
    page = context.new_page()
    page.goto("https://example.com")
    print(page.title())
    context.close()

The default launch uses installed Chrome when detected, falls back to Playwright's channel="chrome", opens headed, uses the platform Chrome user data directory, selects the Default profile, disables Playwright's fixed viewport, and removes the --enable-automation default argument.

Customize the browser or profile

from playwright.sync_api import sync_playwright
from playwright_byob import launch_chrome

with sync_playwright() as p:
    context = launch_chrome(
        p,
        browser_path="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
        user_data_dir="~/Library/Application Support/Google/Chrome",
        profile_directory="Profile 1",
        args=["--window-size=1440,1000"],
        timeout=30_000,
    )

You can also use environment variables:

  • PLAYWRIGHT_BYOB_CHROME_PATH
  • PLAYWRIGHT_BYOB_USER_DATA_DIR
  • PLAYWRIGHT_BYOB_PROFILE_DIRECTORY

Privacy note

A real Chrome profile can contain cookies, local storage, saved sessions, and other sensitive state, so use this intentionally. Tests in this project never read or launch a real user profile. They use temporary directories and fake Playwright objects.

The local integration test is macOS-only and skipped in CI. It launches the installed Chrome executable with an isolated temporary user data directory, then verifies cookie and local storage persistence across two browser sessions.

Download files

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

Source Distribution

playwright_byob-0.1.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

playwright_byob-0.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file playwright_byob-0.1.1.tar.gz.

File metadata

  • Download URL: playwright_byob-0.1.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","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 playwright_byob-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e4ccaf5f1b2be444457311e9098cc80d1276a0fe1788cb0f39b203aac023938d
MD5 9055f27bbc00c77a9d50c1cbc1311663
BLAKE2b-256 cfe1c9f29fd435260ee6914b2f2142681776489eda88d6b89653164118989024

See more details on using hashes here.

File details

Details for the file playwright_byob-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: playwright_byob-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","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 playwright_byob-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c9c0fae0e6b7fd7afa97d8647bb6791f9237aa85d78c994516d4d77d4b21dc3
MD5 f1aa290d4e8e1f0f3765d86d97fea5d0
BLAKE2b-256 3b354ea2b155f13f69e76b6196b68b2d3e69135ebcd3bc70a2ae3bcce1bf3cc1

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