Docs/Field manual

Research collection field manual

Plan a traceable research collection, inspect a public directory, and check whether its records answer your question.

Download .md
Researchers and developers5 min read10 sections
Source reference · Match your SDK version. Availability and known issues
In this guide

1. Write the question before the selector

A collection is useful only when its unit of observation matches the question. A directory row, a document, and a paragraph are different units, even when they refer to the same subject.

The public example collects proposal directory rows and then a separate sample of proposal documents. Do not add the two counts together as though they described distinct proposals.

DecisionPEP exampleReason
SourcePython PEP numerical directoryOne public index lists proposals in table rows.
Directory unitOne row in the indexA page can contain hundreds of records.
Document unitOne linked proposal pageA later job extracts one document per URL.
IdentityRelative proposal URL for the directory jobThe configured fields define exact deduplication.
SampleThe first 20 linked documentsA convenience sample, not a random sample.

2. Choose and describe a source

Inspect the publisher’s documentation, access rules, reuse terms and update schedule. A public page is not automatically suitable for every downstream use. If a maintained API or downloadable dataset already contains your fields, consider using it instead of parsing HTML.

Record the exact source URL, collection date, collector version and configuration with your dataset. A snapshot is a historical observation: the source may change after the run.

3. Inspect the page structure

For the recorded PEP example, the row selector is .pep-zero-table tbody tr. Each matching table row is a separate extraction scope. The second column contains the number, the third contains the title, and the classification is read from an abbr title attribute.

Check more than one row, including rows with missing values or extra links. The initial exploratory extraction included adjacent version text in many titles; selecting the third column corrected that error. A row count alone did not expose the problem.

The source markup may change. Reinspect the page and test your selectors when a field becomes empty, unexpectedly long or semantically wrong.

{
  "row_selector": ".pep-zero-table tbody tr",
  "fields": [
    { "name": "pep_number", "selector": "td:nth-child(2)", "data_type": "integer", "required": true },
    { "name": "title", "selector": "td:nth-child(3)", "required": true },
    { "name": "relative_url", "selector": "td:nth-child(2) a.pep", "extract_type": "attr:href", "required": true },
    { "name": "classification", "selector": "td:nth-child(1) abbr", "extract_type": "attr:title", "required": true }
  ]
}
json9 lines · copy-ready

4. Understand one recorded result

The following is the first record from a local PEP directory collection. Its _row is a position within this extraction, not a permanent identifier. The relative URL must be resolved against _source_url before it is used as an absolute link.

The number is a string in DatasetJob output, even though the job validates it as an integer. Convert it explicitly when your analysis requires a numeric type.

{
  "_row": "0",
  "_source_url": "https://peps.python.org/numerical/",
  "classification": "Process, Active",
  "pep_number": "1",
  "relative_url": "../pep-0001/",
  "title": "PEP Purpose and Guidelines"
}
json8 lines · copy-ready

5. Run the recorded workflow

Run from the repository root so the relative paths in the example point to the expected files. The supplied session identifies the collector and the command sets a rate of one request per second per host.

Use a fresh output directory for a new snapshot. Running an already completed job resumes its existing state; it does not refresh the public website.

cargo build --locked --release --features cli --bin crawlingo
cargo run --locked --release --features cli -- --config examples/research_dataset/session.json --rate-limit-rps 1 dataset examples/research_dataset/index-job.json
shell2 lines · copy-ready

6. Read the result in context

On 19 October 2026 the recorded directory job fetched one page and wrote 744 records in 4.620 seconds. A separate job fetched 20 linked documents and wrote 20 records in 20.539 seconds.

The run used a release-mode Rust CLI on Windows, a concurrency limit of two and a per-host request rate of one per second. These are observations from one paced run, not current counts, a live dashboard, or a maximum throughput claim.

All directory IDs, titles and classifications were compared with an independently parsed source snapshot. Only the PEP 1 document body received the stated text-order comparison; the other 19 document bodies were not semantically certified.

7. Freeze and describe your sample

The included preparation script reads the directory output, verifies the report, resolves relative URLs, validates the expected origin and freezes up to 50 document URLs. It makes no network calls and refuses to overwrite an existing prepared file.

Its default first-20 selection preserves source order. Record that choice in your analysis and do not treat it as representative of all proposals. For a random sample, design and record a separate sampling method and seed.

python examples/research_dataset/prepare_details.py --limit 20
shell1 lines · copy-ready

8. Preserve provenance during transformations

Keep the raw shards unchanged. Store normalized or cleaned records in a separate directory and record the transformation version. Preserve the source URL, source identifier, collection date and the raw snapshot associated with each derived record.

If you split one document into chunks, include the parent document identifier and a chunk position. A chunk is a derived record, not a second independently collected document.

9. Review correctness and coverage

  • Inspect complete, cancelled, pages_failed and records_rejected before accepting the output.
  • Compare a sample of extracted fields with the same source snapshot, including long and unusual rows.
  • Report how many directory entries were discovered and how many documents were actually collected.
  • Keep errors and missing sources in the study record; a completed job can still contain failures.
  • Separate extraction correctness from licensing, statistical representativeness and scientific validity.

10. Know what this experiment does not show

The public run did not collect a million live pages, test maximum throughput, verify every document body, or exercise process-kill recovery. The million-record test used a separate local HTTP fixture with small generated pages.

DatasetJob does not render JavaScript or automatically ingest PDF and JSON API responses. If destination content exists only after a browser runs, a link-discovery handoff alone does not provide the rendered DOM to the job.