Your first dataset
Turn a file of URLs into validated, resumable output in four steps.
In this guide
1. Build the current source
These guides describe the development source. Crawlingo 1.0.0-alpha.2 is an alpha release; compare your installed version with the documented API and use the matching source when needed.
Start with the Rust CLI for the shortest path. Python and Node.js use the same job configuration.
git clone https://github.com/Vamshavardhan50/crawlingo.git
cd crawlingo
cargo build --release --features cli2. Create your input
Save urls.txt in your working directory. Each line is an HTTP or HTTPS URL. This small example uses a public example page with an h1 heading.
https://example.com/3. Define a record
Save job.json beside urls.txt. The title field is required: pages without it are reported instead of exported as valid records. Paths are relative to the process working directory.
{
"urls_file": "urls.txt",
"output_dir": "datasets/pages",
"fields": [
{
"name": "title",
"selector": "h1",
"required": true
}
],
"concurrency": 16,
"format": "jsonl"
}4. Run and inspect the result
Open datasets/pages/part-00000000.jsonl for accepted records. Inspect the report counters and error shards too: complete means the input was processed, not that every page succeeded.
Run the same configuration again to resume. Keep the input file and configuration unchanged, and use a new output directory for a different dataset.
import json
from crawlingo import DatasetJob
with open("job.json", encoding="utf-8") as source:
config = json.load(source)
report = DatasetJob(config).run()
print(report["records_written"])
print(report["pages_failed"], report["records_rejected"])