Docs/Understand Crawlingo

Your first run, step by step

Follow a small local example, understand each file, and learn what a successful or partially successful run looks like.

Download .md
New users4 min read9 sections
Source reference · Match your SDK version. Availability and known issues
In this guide

1. Prepare the tools once

You need a terminal, the current Crawlingo source checkout, Python to serve the sample HTML, and the Rust/native build tools listed in Installation. If native build setup is unfamiliar, ask your developer to help with this step. You do not need to write Rust code to use the CLI.

The terminal is where you enter commands. Its working directory matters: relative paths such as urls.txt are resolved from that directory. Keep one terminal for the local server and open another for running the job.

git clone https://github.com/Vamshavardhan50/crawlingo.git
cd crawlingo
cargo build --release --features cli
shell3 lines · copy-ready

2. Open the example folder

Find examples/product_dataset in the checkout. You will use the supplied files as they are on the first run. The example is local so the expected data does not depend on a changing third-party website.

File or folderPurpose
site/catalog.html and site/more.htmlThe two sample pages.
site/robots.txtAllows the local sample to be fetched.
urls.txtThree URL lines; one is deliberately repeated.
job.jsonThe row, field, quality and identity rules.
run.py / run.cjsAlternative Python and Node entry points.
output/Created by the job; holds data, errors and state.

3. Start the local sample website

In the first terminal, from the repository root, run the command below. Leave it running. Open http://127.0.0.1:8765/catalog.html in your browser to see the source products. The page intentionally contains a product with no name.

python -m http.server 8765 --bind 127.0.0.1 --directory examples/product_dataset/site
shell1 lines · copy-ready

4. Generate the dataset

In the second terminal, start in the repository root, move into the example folder and run its configuration. You will see a JSON report in the terminal. The job also writes that report to output/report.json.

cd examples/product_dataset
cargo run --release --features cli -- dataset job.json
shell2 lines · copy-ready
  • This example deliberately ends with status 2 because one row is rejected. That means you need to inspect the reported issue; it does not mean the two accepted products disappeared. A fatal startup or storage error uses status 1. A fully clean completion uses status 0.

5. Read the result before using it

Open output/part-00000000.jsonl in a text editor. Each line is one accepted product. Then open output/part-00000000.errors.jsonl: its missing-name error points to the affected page and row. The source row index begins at zero.

A complete report means the input reached its end. It can still contain rejected rows. Check the counters every time, including after an automated run.

CounterExpected valueMeaning
pages_fetched2The two distinct catalog pages were processed successfully.
records_written2Two valid products were exported.
records_rejected1A product had no required name.
duplicate_records1The repeated SKU was not exported again.
duplicate_urls1The repeated address was not fetched again.
pages_failed0No page-level failures occurred.

6. Run the command again

Keep the server running and repeat the same job command. The accepted and error counts stay cumulative. The finished pages are not fetched again. elapsed_ms changes because it measures the new invocation.

Do not delete state/ to start over. For a separate experiment, choose a new output_dir in a copy of the configuration. Keep a finished job together so you can trace what produced its data.

7. Make a table for review

To create CSV, copy job.json to job-csv.json, change format to csv and change output_dir to output-csv. Leave the other settings alone. Run the new file. Each part-XXXXXXXX.csv has a header row and can be imported into a spreadsheet or read with a CSV parser.

Identifiers such as SKU should usually stay text when importing. Otherwise a spreadsheet may remove leading zeros. Crawlingo does not control the type inference performed by your spreadsheet application.

cargo run --release --features cli -- dataset job-csv.json
shell1 lines · copy-ready

8. Adapt the workflow to your pages

  • Write down the fields you need and what one record represents.
  • Collect a small sample of page URLs, including pages with missing or unusual values.
  • Inspect the HTML and choose selectors for those fields.
  • Choose required values and a stable record identity.
  • Use a fresh output directory and review every output row in the small sample.
  • Increase the input only after the sample behaves as expected.

If something goes wrong

SymptomFirst thing to check
Connection refusedIs the sample HTTP server still running on port 8765?
job.json or urls.txt not foundIs the second terminal inside examples/product_dataset?
Missing DatasetJob in an SDKDid you build the current wrapper and native extension together?
Configuration changed errorUse a fresh output directory after changing the config or input.
The output folder is lockedAnother process may still own that job; let it stop before resuming.