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 unbrowser

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

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}]. Refs are stable handles for click/type/submit.
  • extract() — auto-strategy structured data: tries JSON-LD → __NEXT_DATA__ → Nuxt → OpenGraph → microdata → text fallback, returns highest-confidence hit.
  • click(ref) / type(ref, text) / submit(ref) — interaction. POST and GET forms supported. Checkboxes/radios tracked.
  • 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 Distribution

pyunbrowser-0.0.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

pyunbrowser-0.0.1-py3-none-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file pyunbrowser-0.0.1.tar.gz.

File metadata

  • Download URL: pyunbrowser-0.0.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for pyunbrowser-0.0.1.tar.gz
Algorithm Hash digest
SHA256 86851fde8f58b3147c4b27aa8fcb31ff124a0e6b2b637256ed669f9edba2c80e
MD5 eff09ff5f4f12a81fc7787e0f84f7b2a
BLAKE2b-256 efe54caaed73c065287b4a0a22a0ed618424cbd2c90a536c2ad5849fdef18190

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyunbrowser-0.0.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fceeb1aeeb71669a0a05f4de23cdc3262a397a7684536760079bcd1c56634440
MD5 07d482868e1573d95d1d1138e9da3679
BLAKE2b-256 3212f87a689063ea88c6887e028fa1b7011cbb651b77748d22c7f6e969c8810d

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