Skip to main content

Web access for LLM agents. One static binary. No Chrome.

Project description

unbrowser

Web access for LLM agents. One static binary. No Chrome.

Single-file native headless browser optimized for LLM agents. Runs JavaScript via QuickJS, returns a low-token page summary on every navigate, and gives you stable element refs for click/type/submit. Tens of MB RAM per session, no Chrome dependency.

pip install pyunbrowser   # PyPI name; the import is `from unbrowser import ...`

The wheel ships the native binary for your platform — there's nothing else to install.

For transparent bot-wall cookie handoff through local Chrome, install the optional solver extra:

pip install 'pyunbrowser[solver]'  # includes unchainedsky-cli
unbrowser cookie-service --headless --profile unbrowser-cookie-service
unbrowser router https://example.com/protected

The solver service binds to 127.0.0.1 by default and returns cookies from the user's local Chrome/unchained session. It does not fabricate challenge tokens. Private/reserved/internal hosts are rejected unless explicitly allowed with --allow-host.

Quick start

from unbrowser import Client

with Client() as ub:
    r = ub.navigate("https://news.ycombinator.com")
    for s in ub.query(".titleline > a")[:3]:
        print(s["text"], s["attrs"]["href"])

Why

curl This Playwright / headless Chrome
Static / SSR pages ✅ but token-heavy ✅ low-token BlockMap overkill
SPA-shell sites (with exec_scripts) ⚠️ partial
Bot-walled (cookie handoff)
Run in Lambda / Workers / edge ❌ Chrome too big
Per-page cost at 100K/day ~free ~free $$$
LLM-shaped output DIY parse ✅ inline BlockMap DIY parse

What it does

  • navigate(url) — fetch, parse, return {status, url, bytes, headers, blockmap, challenge}. With exec_scripts=True, runs page JS in QuickJS (bounded by a 30s watchdog so it can't wedge).
  • query(selector) — CSS query → [{ref, tag, attrs, text, text_chars, text_truncated}]. Refs are stable handles for click/type/submit.
  • query_debug(selector) — diagnose selector misses with match counts, samples, DOM summary, and selector hints.
  • extract() — auto-strategy structured data: tries JSON-LD → __NEXT_DATA__ → Nuxt → OpenGraph → microdata → text fallback, returns highest-confidence hit.
  • extract_table(selector) / table_to_json(selector="table") — normalize HTML tables into headers, rows, and row count.
  • click(ref) / type(ref, text) / submit(ref) — interaction. GET and application/x-www-form-urlencoded POST forms supported; multipart is not yet supported. Checked checkbox/radio values are serialized.
  • cookies_set(...) — paste cookies from a real Chrome session to bypass bot detection (Cloudflare, PerimeterX, Datadome). Solve once, replay forever.

Full RPC reference, BlockMap shape, challenge detection, profile system, and architecture: github.com/protostatis/unbrowser.

Honest limits

  • Heavy framework SPAs (Ember/React) often don't auto-mount inside QuickJS even with exec_scripts=True — the watchdog ensures it returns, check density.likely_js_filled to decide whether to escalate.
  • No screenshots (out of scope by design).
  • Hardest-tier anti-bot (FingerprintJS Pro, Kasada, advanced Akamai BMP) needs the cookie handoff path. The binary detects and labels the challenge for you.

License

Apache-2.0.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pyunbrowser-0.0.13-py3-none-manylinux_2_35_aarch64.whl (4.4 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARM64

pyunbrowser-0.0.13-py3-none-manylinux_2_31_x86_64.whl (4.6 MB view details)

Uploaded Python 3manylinux: glibc 2.31+ x86-64

pyunbrowser-0.0.13-py3-none-macosx_11_0_arm64.whl (4.1 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

pyunbrowser-0.0.13-py3-none-macosx_10_12_x86_64.whl (4.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file pyunbrowser-0.0.13-py3-none-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for pyunbrowser-0.0.13-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 bf603f62b29a21257201e05d12d92e98ede0ce47710b874ba078dc171ba4e304
MD5 3c8b8b49da0b4dea5eac0a1f5415cbe1
BLAKE2b-256 66d8925c218f3f2107dfdb7b97386194e1906bae2a6232bb2b2717136bcfcbd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyunbrowser-0.0.13-py3-none-manylinux_2_35_aarch64.whl:

Publisher: release.yml on protostatis/unbrowser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyunbrowser-0.0.13-py3-none-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for pyunbrowser-0.0.13-py3-none-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 e1da54addad49a9c0c8a7c43d41ab6b9a6fdd3b074377801b94613fc7809a516
MD5 4081bcf70ede16265b2399d4ace7e760
BLAKE2b-256 de31e7bc60faf747d567a6c5e22efacdebbb4daaf15b06860d0e91a2f612dbff

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyunbrowser-0.0.13-py3-none-manylinux_2_31_x86_64.whl:

Publisher: release.yml on protostatis/unbrowser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyunbrowser-0.0.13-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyunbrowser-0.0.13-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 62c29cb8444321048f6fa3b022689028749a632059617df4ca370fad93d1d8a5
MD5 3fb97a5f7e9e5fa449d004687336a352
BLAKE2b-256 4a5ec0714bc59ea59d514e83fec491409e8b65270f5290c6ee6960aac05896de

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyunbrowser-0.0.13-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on protostatis/unbrowser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyunbrowser-0.0.13-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyunbrowser-0.0.13-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 140ecef07f4cff621fc92f8e423f57fd5464c62038c2a8038fa9eba816c4153c
MD5 f130bf4c7cb3bb5cc6cfdfbf5501bfbe
BLAKE2b-256 ff2add1cdfe2c635951f4de016b66756a2ee5d39a91e6534113be10498522574

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyunbrowser-0.0.13-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on protostatis/unbrowser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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