Skip to main content

Stealth browser CLI that bypasses WAFs and bot detection

Project description

Phantom

Stealth browser CLI that bypasses WAFs and bot detection. Built on Playwright with anti-detection patches so you can fetch pages that block headless browsers, curl, and wget.

Works as a CLI tool for humans and outputs structured JSON for AI agents.

Install

pip install phantom-browse

Chromium is installed automatically on first run. To install it manually:

python -m playwright install chromium

Usage

# Get page text
phantom https://example.com

# Structured JSON output (for agents)
phantom https://example.com --json

# Screenshot
phantom https://example.com --screenshot page.png

# Login flow
phantom https://app.com/login \
  --fill "input[name=email]=user@example.com" \
  --fill "input[name=password]=secret" \
  --click "button[type=submit]" \
  --session myapp \
  --json

# Reuse session (skip login next time)
phantom https://app.com/dashboard --session myapp --json

JSON Output

When using --json, Phantom returns:

{
  "ok": true,
  "url": "https://example.com",
  "title": "Example Domain",
  "text": "...",
  "screenshot": null,
  "console_errors": []
}

On failure:

{
  "ok": false,
  "url": "https://example.com",
  "error": "Navigation failed: net::ERR_NAME_NOT_RESOLVED"
}

Interaction Flags

Actions execute in order, before the final page capture.

--click SELECTOR        # Click element (coordinate-based, human-like timing)
--fill SEL=VAL          # Fill input field (instant)
--type SEL=VAL          # Type into input (80ms per-character delay)
--wait SELECTOR         # Wait for element to appear

Chain them:

phantom https://app.com \
  --wait "form" \
  --fill "input[name=q]=test" \
  --click "button[type=submit]" \
  --json

Options

--json              Structured JSON output
--screenshot PATH   Save full-page screenshot
--session NAME      Cookie persistence (~/.phantom/sessions/)
--timeout MS        Navigation timeout (default: 30000)
--headless          Force headless mode
--headed            Force headed mode (requires display/Xvfb)
--locale LOCALE     Browser locale (default: en-US)
--timezone TZ       Browser timezone (default: America/New_York)
--viewport W H      Viewport size (default: 1366 768)
--verbose           Debug logging

What It Bypasses

Phantom bundles these anti-detection techniques:

  • playwright-stealth — masks automation fingerprints
  • WebDriver spoofing — hides navigator.webdriver
  • Blink feature flags — disables AutomationControlled
  • Realistic fingerprint — Chrome 131 User-Agent, configurable locale/timezone/viewport
  • Headed mode — uses real GUI via Xvfb when available (harder to detect than headless)
  • Human-like input — variable click timing, coordinate-based clicks, realistic type delays

Using With AI Agents

Phantom is designed to be called by AI agents via subprocess. The --json flag gives structured output any agent can parse:

import subprocess, json

result = subprocess.run(
    ["phantom", "https://example.com", "--json"],
    capture_output=True, text=True
)
data = json.loads(result.stdout)
if data["ok"]:
    page_text = data["text"]

License

MIT

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

phantom_browse-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

phantom_browse-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file phantom_browse-0.1.0.tar.gz.

File metadata

  • Download URL: phantom_browse-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for phantom_browse-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c387409e582a1f257278e22e703f975b4f111d6cace27ab2059b2d005a35f64d
MD5 e25f9bcf0da12a369de3bc87f23999e0
BLAKE2b-256 345f69097a8985cf574596e2e69d4968bc3d89bf0a384a27f5d1b94f7fcdc528

See more details on using hashes here.

File details

Details for the file phantom_browse-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: phantom_browse-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for phantom_browse-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 857b2982e686a4e831b1d1729fa88cf920fd420d44a6dd248cd11f79f7346ad6
MD5 cdf5335200b6cf589b8f23b66814b3bc
BLAKE2b-256 c1a7af51de283ca1b25e48b0557a4aaf5ef2dd153412bd3f0d8a503662cc9307

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