Skip to content

Latest commit

 

History

History

README.md

Basic Examples

Simple examples demonstrating core Reader functionality.

Prerequisites

Before running examples, start Ulixee Cloud in a separate terminal:

npx @ulixee/cloud start

For production server usage with shared Core, see examples/production/express-server.

Examples

basic-scrape.ts

Scrape a single URL and display the results.

npx tsx basic-scrape.ts

batch-scrape.ts

Scrape multiple URLs concurrently.

npx tsx batch-scrape.ts

crawl-website.ts

Crawl a website to discover and scrape pages.

# Crawl example.com
npx tsx crawl-website.ts

# Crawl a specific URL
npx tsx crawl-website.ts https://docs.example.com

all-formats.ts

Output content in all supported formats (markdown, html).

npx tsx all-formats.ts

with-proxy.ts

Scrape using a proxy server.

# Set proxy URL
export PROXY_URL="http://user:pass@proxy.example.com:8080"
npx tsx with-proxy.ts

Running Examples

  1. Install dependencies in the examples folder:

    cd examples
    npm install
  2. Run any example:

    npx tsx <example-name>.ts