Running Scraping as a Function, Not a Project

Cover for “Running Scraping as a Function, Not a Project”: control chart catching a drop in valid records, service objectives and a runbook

5 min read

A scraping project ends at launch. A data collection function starts there. Sites change their templates, add variants and move prices around; owners change their terms or ask you to stop; downstream teams change what they need. A pipeline without owners, objectives and a runbook degrades quietly until someone notices bad numbers in a decision. This article describes an operating model for collection after launch. It is a proposed practice, drawn from the official documentation cited, not a survey of how teams operate.

Key takeaways

  • Give every recurring decision one accountable owner: approving sources, setting collection policy, accepting deliveries and responding to a request to stop.
  • Track a small set of service objectives: accepted coverage, freshness, sampled precision and cost per 1,000 accepted records.
  • A control chart on daily accepted coverage catches a template change the day it happens, before anyone downstream sees it.
  • Write the runbook before the incident, including one that is easy to forget: the site owner asks you to stop.
  • Keep history as data. Snapshot tools such as dbt record changes over time instead of overwriting them.

Owners before tools

A failure in collection quickly becomes an ownership question: the parser broke and nobody was paged, or a delivery was wrong and nobody had the authority to reject it. Four roles cover the decisions that recur.

One name per decision

A proposed responsibility matrix for a data collection function

DataownerCollectionoperatorQualityownerLegalcontactApprove a new sourceARCCSet rate, schedule and robots.txt handlingCAICFix a broken parserIAC·Accept or reject a deliveryICA·Change the output schemaARC·Respond to a request to stopIRIADelete data on request or at end of retentionARICAaccountable, one per rowRdoes the workCconsulted beforeIinformed after
Proposed operating model by JsonEngine, not an industry standard; adapt the roles to your organization. Graphic: JsonEngine.
Data behind the chart
ActivityData ownerCollection operatorQuality ownerLegal contact
Approve a new sourceARCC
Set rate, schedule and robots.txt handlingCAIC
Fix a broken parserIAC
Accept or reject a deliveryICA
Change the output schemaARC
Respond to a request to stopIRIA
Delete data on request or at end of retentionARIC

The legal contact is accountable for one row on purpose. When a site owner asks you to stop, or changes terms that matter, the decision to continue shouldn’t sit with the team whose job is to keep collection running. The collection operator stops first and asks second.

Service objectives worth tracking

ObjectiveDefinitionWhy it matters
Accepted coverageAccepted offers divided by expected offers, per source per dayThe first metric to move when a template changes
FreshnessTime from observation to delivery, and age of the newest observation per sourceStale data looks like valid data
Sampled precisionShare of a random sample that matches the live page on manual reviewCatches values that pass validation but are wrong
Cost per 1,000 acceptedAll attributable cost divided by accepted records, times 1,000Shows when retries, rendering or rework creep up
Request load per siteRequests per minute and concurrency, per domainKeeps collection within the policy you set

Proposed objectives by JsonEngine. Set targets from your own baseline rather than from a published standard; we know of none for this.

Request load belongs on the list because defaults are not policy. Scrapy’s defaults, for example, allow 16 concurrent requests overall and 8 per domain with no download delay, and its AutoThrottle extension is disabled unless you turn it on. Whatever your tool, the per-site limits should be a written decision with an owner.

Detecting breakage early

Alerts on hard failures are easy: the job crashed, the file is empty. The dangerous failures are soft: a template change that moves the price into a new element, so the parser returns the old price, or nothing, for a fraction of products. A control chart on accepted coverage catches those.

Catch the break the day it happens

Share of expected offers accepted after validation, per day, with control limits

86%90%94%98%day 1day 15day 30day 45day 60lower 95.7%upper 98.9%mean 97.3%baselinemonitoringtemplate changeparser fixedSimulated data. Limits are the baseline mean plus or minus three standard deviations.
Simulation by JsonEngine (seeded); the metric definition and limits are a proposed practice, not a published benchmark. Graphic: JsonEngine.
Data behind the chart
MeasureValue
Baseline mean, days 1 to 3097.3%
Lower and upper control limits95.7% and 98.9%
Day 3997.1%
Day 4097.7%
Day 4188.6%
Day 4291.6%
Day 4395.9%
Day 4497.4%
Day 4598.2%

The method is simple. Use a stable period to set a baseline mean and limits, then flag any day outside them. In the simulation, the template change pushes coverage below the lower limit the same day. A fixed threshold, such as alerting below 90%, would have caught the worst day and missed the next.

Two practices make the chart trustworthy. Count expected offers from an independent list, such as the previous day’s catalog or the sitemap, not from what the parser found. And keep the raw pages for a short window, so you can re-parse after a fix instead of re-fetching.

A runbook for the incidents that recur

IncidentSignalFirst actionOwner
Template changeAccepted coverage below limit for one sourcePause delivery for that source; re-parse stored pages after the fixCollection operator
Rising errors or refusalsMore 429, 403 or 5xx responsesSlow down; honor Retry-After; stop and review if refusals persistCollection operator
Retry stormRequests per accepted record climbingCap retries at one layer of the stackCollection operator
Plausible but wrong valuesSampled precision drops, or price jumps fail range checksQuarantine affected records; fix and backfillQuality owner
Robots.txt or terms changeDaily diff of robots.txt and terms pagesApply the new rules; escalate terms changesLegal contact
Owner asks you to stopEmail, letter or noticeStop collection from that source, then reviewLegal contact

Three rows lean on published guidance. RFC 9309, the robots.txt standard, says its rules “are not a form of access authorization”, so a refusal or a request to stop is a decision point, not something to engineer around. Google treats a robots.txt file as cacheable for up to 24 hours, which is a reasonable bound on how stale your copy should be. And on retries, Amazon’s Builders’ Library shows how retrying at every layer multiplies load: with five layers each retrying three times, one failing call becomes 243 attempts at the bottom of the stack.

Keep history as data

Collection that overwrites yesterday’s values loses the record of what changed and when. Snapshot tools formalize this: dbt snapshots implement type-2 slowly changing dimensions, adding valid-from and valid-to columns as records change, and can mark records that disappear from the source. The same history is what lets you answer “when did this break?” and “what did we deliver on that date?”. For related reading, see matching products across stores and the competitor price monitoring guide.

Quick answers

Who should own a web scraping pipeline?

Split ownership by decision. A business data owner approves sources and schema changes, a collection operator runs and fixes collection, a quality owner accepts or rejects deliveries, and a legal contact decides on requests to stop and terms changes.

What should I monitor in web scraping operations?

Accepted coverage per source per day, freshness, sampled precision against live pages, cost per 1,000 accepted records, and request load per site. Hard failures are easy to alert on; soft failures need coverage and precision tracking.

How do I detect when a site changes its layout?

Track the share of expected offers accepted after validation, per source per day, on a control chart. A template change that breaks extraction for part of the catalog shows up as a drop below the lower control limit.

What should happen when a site owner asks you to stop?

Stop collection from that source first, then review with your legal contact. RFC 9309 notes that robots.txt rules are not a form of access authorization; a direct request to stop is a clearer signal still.

Why keep historical snapshots of scraped data?

So you can tell when values changed and reproduce what you delivered on a given date. dbt snapshots, for example, record type-2 history with valid-from and valid-to columns.

Rather not run it yourself?

We operate collection as a service, with monitoring, change handling and validated delivery. See our services or get in touch.