Skip to main content

FetchQuest

FetchQuest

CI Python 3.14 License: MIT

FetchQuest is a resilient command-line web fetcher that escalates from plain HTTP to browser-like requests and, when needed, a real Playwright browser. It returns readable content instead of leaving the caller to diagnose blocks, JavaScript shells, rendering delays, and vanished pages.

$ fetchquest https://example.com/app --strategy playwright --wait-selector "#results" -v
# https://example.com/app → playwright (status 200)

Why FetchQuest

  • Automatic escalation — try lightweight HTTP first, add browser headers when needed, and launch Chromium for JavaScript-rendered pages.
  • Content-aware results — preserve raw responses, convert pages to readable text, or extract the main article content without surrounding boilerplate.
  • Bounded browser readiness — require load, network-idle, or a visible CSS selector while keeping all waits inside one hard deadline.
  • Reliable bulk work — fetch URL lists, continue through individual failures, avoid filename collisions, and write a Markdown report.
  • Careful archive recovery — the opt-in Wayback strategy runs only after the original resource returns 404 or 410.
  • Agent-friendly — use the CLI directly or install the included Claude Code plugin as a resilient replacement for WebFetch.

Install

Run a tagged release without installing it:

uvx fetchquest https://example.com

For a persistent command:

uv tool install fetchquest
fetchquest https://example.com
fetchquest --version

To run the latest unreleased source directly from main:

uvx --from git+https://github.com/slukyano/fetchquest fetchquest https://example.com

The Playwright strategy needs a one-time Chromium installation:

uvx playwright install chromium

Python 3.14 or newer and uv are required.

Quick start

# Fetch readable text to stdout
fetchquest https://example.com

# Save raw HTML and readable text
fetchquest https://example.com \
  --output pages/ \
  --formats raw,text

# Extract only the main article content
fetchquest https://example.com --formats text-trim

# Require JavaScript-rendered content to appear
fetchquest https://example.com/app \
  --strategy playwright \
  --wait-selector "#results article"

# Fetch a list and recover genuinely missing pages from Wayback
fetchquest --input urls.txt \
  --output pages/ \
  --formats raw,text \
  --strategy smart-cache

Each input-file line contains a URL and an optional output prefix:

https://example.com/pricing pricing
https://example.com/about

How the smart chain works

  1. Fetch with plain httpx.
  2. If that does not return HTTP 200, retry with browser-like headers.
  3. When a successful HTML response is only an empty JavaScript shell, render it with Playwright.
  4. When both HTTP strategies fail because of TLS, try Playwright.
  5. With smart-cache, consult Wayback only if an original HTTP response was 404 or 410.

Retries apply to transient failures such as HTTP 429, HTTP 503, and network timeouts. The per-URL --timeout remains the hard deadline across strategy attempts, retries, browser startup, required waits, render settling, and capture.

Strategies and formats

Strategy Behavior
smart Automatic HTTP, browser-header, and Playwright chain
smart-cache Smart chain plus Wayback for original 404/410 responses
simple Plain httpx request
ua-spoof httpx with browser-like request headers
playwright Headless Chromium
cache Wayback Machine only
Format Behavior
text Readable Markdown-like text; the default
text-trim Main content without navigation, footers, or ads
raw Original response bytes

Run fetchquest --help for all options. The CLI specification documents exact defaults, constraints, output behavior, readiness semantics, and exit codes.

Claude Code plugin

Install FetchQuest as a Claude Code plugin:

claude plugin marketplace add slukyano/fetchquest
claude plugin install fetchquest@fetchquest

The included fetch skill teaches Claude when to use FetchQuest and how to select formats, strategies, and browser-readiness controls.

Development

Setup, validation, network-test, documentation, and pull-request guidance lives in CONTRIBUTING.md. Project documentation starts at docs/index.md, and user-visible changes are tracked in CHANGELOG.md.

License

MIT

Metadata

Release files for fetchquest 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fetchquest 0.1.0
File Size Uploaded
fetchquest-0.1.0.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fetchquest 0.1.0
File Interpreter ABI Platform
fetchquest-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.5 kB

Release files / fetchquest-0.1.0.tar.gz

Download URL fetchquest-0.1.0.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
874eb5bc25b89e1d43969182fe519f484de6de71dce5d966f6ac669975f35dbe
BLAKE2b-256 checksum
How to use checksums
1d31d316cdf9175160a4c38786d6159e9c052f6343af26b6dc0289191211a19e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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}

Release files / fetchquest-0.1.0-py3-none-any.whl

Download URL fetchquest-0.1.0-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9ad8fe2d00f8d6c5edca9717ce8c706888bd8408199d14f150cc1325477df26
BLAKE2b-256 checksum
How to use checksums
49d9b2de6b83c15d6e185aa6e9a998535b98405b8e6bc4d659eee44fb18efcdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","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}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page