lacspace-scraper

Scrape structured data from any website — CSS selectors or auto-detect.

terminal
npx lacspace-scraper https://example.com --auto -f json
What it does

Everything, in one command

lacspace-scraper ships its own zero-dependency HTML parser and CSS-selector engine, so a fast static engine handles most sites with no browser at all — and an optional real-browser mode renders JavaScript apps when you need it. Extract exactly the fields you want with a selector schema, turn repeating cards into one record each, or let the auto-detectors grab everything a page exposes.

Features

What's inside

Selector schema

Map fields to CSS selectors (text, @attributes, inner HTML, or all matches as an array).

Repeating items

--item ".card" yields one record per element — product grids, list rows, search results.

Auto-detect

Metadata, headings, links, images, emails, phones, tables, JSON-LD, OpenGraph, feeds and readable text.

Static or browser

A fast zero-dependency engine by default; a real browser (--browser) for JavaScript-rendered sites.

Crawl a site

Follow links breadth-first with depth/page limits, seed from a sitemap, stay same-origin.

Polite by default

Respects robots.txt, with delay, jitter, retries, concurrency and a custom User-Agent.

Parser included

The HTML parser + CSS-selector engine are exported — use them on any HTML string, no network.

Any format

JSON, NDJSON, CSV or Excel, plus a built-in converter between all four.

How to use

Copy, paste, done

Real commands and snippets — from a one-liner to the typed library.

Grab everything a page exposes
terminal
npx lacspace-scraper https://example.com --auto -f json

Title, meta, headings, links, images, OpenGraph, JSON-LD…

Scrape a product grid to Excel
terminal
npx lacspace-scraper https://shop.site \
  --item ".product-card" \
  --field "name=h3" --field "price=.price" --field "url=a@href" -f xlsx

One row per product card.

Crawl a docs site, keep text
terminal
npx lacspace-scraper crawl https://docs.site \
  --depth 2 --limit 40 --auto metadata,text -f ndjson

BFS crawl, robots-aware, metadata + readable text per page.

Use the parser directly
typescript
import { parseHTML, applySchemaItems } from "lacspace-scraper";

const root = parseHTML(html);
const rows = applySchemaItems(root, ".product",
  { name: "h3", price: ".price", url: { selector: "a", attr: "@href" } });
Good for

What people build with it

Turn any website's listings into a spreadsheet

Monitor prices, jobs, listings or catalog changes

Build a dataset from a site's sitemap

Extract metadata, tables or JSON-LD at scale

Start now

Run lacspace-scraper today

Free, open-source, no API keys. It's a CLI and a typed library.

terminal
npx lacspace-scraper https://example.com --auto -f json