Crawl and Extract URLs
This guide walks you through crawling web pages and extracting structured data from them using Sterndesk’s Crawl Collector.Prerequisites
Before you begin, ensure you have:- An API key with appropriate permissions (see Authentication)
- An existing organization and project (see the guide)
proj_xyz789 as an example.
Step 1: Create an Extraction Schema
An extraction schema defines the structure of data you want to extract from web pages. Create a schema that matches the information you’re looking for. For this example, we’ll create a schema to extract article information from web pages:The
json_schema field must be a JSON-encoded string, not a nested object. See Extraction Schemas for details on schema encoding.exsc_abc123) for the next step.
Step 2: Create a Crawl Collector
A Crawl Collector is a collector that fetches and processes web pages. When you attach an extraction schema to it, crawled pages are automatically extracted upon completion (Direct Extraction mode).strategy field specifies the crawling engine. Currently, CRAWL_STRATEGY_FIRECRAWL is the only supported strategy.
Response:
crw_coll_def456) for creating crawls.
Step 3: Create a Crawl
To crawl a web page, create a crawl request specifying the URL you want to process:Step 4: Poll for Results
Poll the crawls endpoint to check the status of your crawl:Deleting a Crawl Collector
When you no longer need a crawl collector, you can delete it.Next Steps
Extraction Schemas
Learn more about designing extraction schemas
Upload Documents
Extract data from uploaded documents instead of web pages