For the complete documentation index, see llms.txt. This page is also available as Markdown.

Your first fetch

obscura fetch loads a URL, runs its JavaScript, and prints the result.

Load a page

obscura fetch https://example.com

Prints the rendered HTML.

Run JavaScript with --eval

obscura fetch https://example.com --eval "document.title"
"Example Domain"

Returns JSON:

obscura fetch https://news.ycombinator.com \
  --eval "Array.from(document.querySelectorAll('.titleline a')).slice(0, 5).map(a => a.textContent)"

Multi-statement eval

--eval evaluates one expression. For multiple statements, wrap in an IIFE:

obscura fetch https://example.com --eval "(function(){
  const links = document.querySelectorAll('a');
  return Array.from(links).map(a => a.href);
})()"

A bare block starting with const or let returns null because V8 gives top-level declarations an empty completion value.

Wait for the right moment

CLI default is load. For faster returns on slow sites:

Level
Returns when

domcontentloaded

HTML parsed, scripts ran

load

All subresources finished (default)

networkidle2

≤2 network connections active for 500ms

networkidle0

0 network connections active for 500ms

(When driving obscura via Puppeteer or Playwright the default is domcontentloaded to match client expectations.)

Common flags

Full list: CLI reference.

Last updated

Was this helpful?