Skip to main content
The inspect command fetches and analyzes a website to help you understand its structure and build scraper configurations. It supports three modes: lightweight HTTP, browser-based (for JavaScript sites), and Cloudflare bypass.

inspect

Inspect a website URL.

Syntax

Arguments

url
string
required
Website URL to inspect.

Options

--project
string
default:"default"
Project name (used for saving analysis files).
--output-dir
string
Directory to save analysis files. Defaults to data/<project>/inspect/.
--proxy-type
choice
default:"auto"
Proxy type: none, static, residential, auto.
--no-save-html
flag
Do not save the full HTML to disk.
--browser
flag
Use browser automation for JavaScript-rendered sites and Cloudflare bypass. Automatically handles browser challenges and renders dynamic content.
--log-level
choice
default:"info"
Logging level: debug, info, warning, error, critical.
--log-file
string
Path to log file.

Modes

HTTP Mode (Default)

Lightweight HTTP fetch with requests library:
Use for:
  • Simple websites with server-side rendering
  • Static HTML sites
  • Fastest inspection method
Output:

Browser Mode

Use Playwright for JavaScript-heavy sites:
Use for:
  • Single-page applications (React, Vue, Angular)
  • Sites with JavaScript-rendered content
  • Dynamic content loading
Output:
Browser mode waits for JavaScript to execute and renders the final DOM. This is the HTML you should analyze for extraction selectors.
Additional browser mode features:
  • Automatic Cloudflare challenge detection and bypass
  • Cookie extraction for session persistence
  • Browser fingerprinting resistance
Linux (headless server): Requires xvfb for browser automation:
Install xvfb if needed:
Output when Cloudflare is detected:

Saved Files

Inspection saves files to data/<project>/inspect/<domain>/:

page.html

Full HTML content:
  • HTTP mode: Raw HTML from server
  • Browser mode: Rendered HTML after JavaScript execution
Use this file with the analyze command to discover CSS selectors.

metadata.json

Request metadata:

cookies.json (Browser mode with Cloudflare)

Cloudflare session cookies:
These cookies can be used in spider settings to bypass Cloudflare without browser on every request.

screenshot.png (Browser mode)

Full-page screenshot for visual verification.

Proxy Support

Specify proxy type for inspection:
Requires proxy configuration in .env.

Skip HTML Saving

For quick inspection without saving files:

Logging

Control logging verbosity:

analyze

Analyze saved HTML for CSS selector discovery (separate command, not a subcommand of inspect).

Syntax

Arguments

html_file
string
required
Path to HTML file to analyze.

Options

--test
string
Test a specific CSS selector.
--find
string
Find elements by keyword (searches classes and IDs).

Examples

Output (Analysis Mode)

Test a Selector

Use ::text pseudo-selector to extract text content instead of HTML.

Find by Keyword

extract-urls

Extract all URLs from a saved HTML file. Useful for understanding URL patterns on a site during analysis.

Syntax

Arguments

--file
string
required
Path to HTML file to extract URLs from.

Options

--output
string
Output file path. If not specified, URLs are printed to console.
-o
string
Short form of --output.

Examples

Output

When using --output, URLs are written one per line to the specified file:
Use extract-urls after inspect to analyze URL patterns and design spider rules. Look for common patterns like /articles/[year]/[month]/[slug] to write effective regex rules.

Workflow: Inspect to Spider Config

1. Inspect the Site

2. Extract URLs (Optional)

Review URL patterns to design effective spider rules.

3. Analyze HTML Structure

Note the CSS selectors for title, content, author, etc.

4. Test Selectors

5. Create Spider Config

Write spider.json using discovered selectors:

6. Import and Test

Platform Notes

macOS/Windows

Browser mode uses native display automatically (no xvfb needed).

Linux (Headless Servers)

Browser automation requires xvfb (covered in Browser Mode section above).

Troubleshooting

Browser Launch Failed

Solution:

Invalid URL

Solution: Ensure URL includes protocol:

Next Steps

Spider Management

Import your spider configuration

Crawl Commands

Test your spider with a crawl