Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. Scraping That Keeps Working
Python & Django

Scraping That Keeps Working

Web scraping with Python that keeps working: checking terms and robots files, rate limiting, coping with structure changes and spotting silent failure.

Updated 2 min readBy SpiderHunts Technologies

Free estimateNo obligation

Get a free estimate

Tell us what you need. A senior engineer reads every enquiry.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →

Quick answer — TL;DR

Check the terms and the robots file, rate limit yourself, expect the structure to change, and monitor for silent failure — a scraper returning nothing looks like a site with no data.

Check what you are permitted to do

Before building anything, read the site's terms and its robots file. Some sites permit collection, some prohibit it, and some offer an API that makes scraping unnecessary.

An API, where one exists, is always better: stable, documented, permitted and less work. Check for one before building a scraper.

Be a considerate client

  1. Rate limit yourself well below anything that would burden the site
  2. Identify yourself honestly in the user agent
  3. Cache so you do not fetch the same page repeatedly
  4. Respect the robots file
  5. Back off when you receive errors rather than retrying immediately

Structure changes will break it

Websites change without notice. A scraper depending on a specific structure will break, and the question is only whether you find out immediately or in six weeks.

  • Validate that extracted data looks plausible before storing it
  • Alert when the extraction rate drops
  • Alert when a field is suddenly empty across all records
  • Store the raw response so a change can be diagnosed

Monitor for silent failure

SignalMeans
Zero records extractedStructure changed or blocked
Records extracted but fields emptySelectors broken
Values outside expected rangesParsing wrong
Sudden volume changeSource changed
Increasing error responsesBeing rate limited or blocked

A scraper that returns nothing and reports success is the standard failure, and it is entirely preventable with a plausibility check.

Handle personal data properly

Publicly accessible does not mean freely usable. Personal data collected from the web carries the same obligations as personal data collected any other way.

Decide the lawful basis, the retention and the purpose before collecting, rather than after.

FAQ

Frequently asked questions

The questions readers ask us after this guide.

Still have a question?

Ask us directly — a senior engineer will get back to you.

Ask about your project

Is web scraping legal?

It depends on jurisdiction, the site's terms, and what you collect. Public factual data is generally more defensible than personal data. Take advice where it matters.

How do we handle sites that block scrapers?

Consider whether you should be scraping them at all. Circumventing deliberate blocking is a different proposition from collecting from a site that permits it.

What about JavaScript-rendered pages?

A headless browser handles them at considerably higher cost. Check whether the data is available in an underlying request first.

How often do scrapers break?

Frequently. Budget for ongoing maintenance rather than treating it as a one-off build.

Keep reading

More on Python & Django

Python & Django

An API Other Systems Can Depend On

Designing a Python API service others can depend on: validation at the boundary, consistent errors and status codes, early versioning and documentation.

Python & Django

Moving and Transforming Data Reliably

Building data pipelines in Python that cope with malformed input: restartable stages, quarantining failures, reconciling counts and alerting on absence.

Start here

Scraper that stopped working and nobody noticed?

Plausibility checks and absence alerting prevent that. Happy to look at what you are running.

  1. You tell us what you needTwo minutes on the form, or a message on WhatsApp.
  2. A senior engineer reviews itAnd comes back with questions, a realistic range and an honest view on fit.
  3. Free 30-minute scoping callWe talk through scope, options and a realistic estimate — with no obligation.
Free estimateNo obligation

Talk to someone who builds this

Send a short brief and we will come back with an honest view and a realistic range.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →