ScrapeCatJoin the waitlist

Where "scrape" comes from, and what it says about web scraping

A short script that pulls a price off a shop page and prints it is often a programmer's first scraper. The word is odd for the job. It sounds like something you do to a windscreen in January.

It turns out that is almost exactly right.

A word for removing a surface

English scrape goes back to Old English scrapian, and the standard story is that Old Norse skrapa had a hand in it, either as the source or as a reinforcement of a native word. Related forms turn up across the Germanic languages: Dutch schrapen, for one. The core meaning in all of them is physical. You drag something hard across a surface and remove a thin layer, or you make a rough, grating sound doing it.

Nobody should lean too hard on the exact line of descent. Early records are sparse, and Old English and Norse were close enough that borrowing and shared inheritance are tangled together. What is safe to say is that the verb is old, Germanic and about friction.

From that one image, English grew a family. You scrape butter onto toast. You scrape together enough money, which is the same motion applied to coins at the bottom of a bag. You scrape by. You scrape the plate. The figurative uses all keep one feature: what you get is thin, and you had to work for it.

How it ended up on a web page

Scraping data off a screen is a much younger usage. Before browsers, programmers talked about "screen scraping": reading the text a terminal displayed because the system behind it had no proper interface. You could not ask the mainframe for data, so you took it off the glass. Web scraping is the same trick with HTML in place of a green terminal.

The metaphor is a little unflattering and it is accurate. Scraping is what you do when there is no door. If a site offers an API, you use the API. You scrape when all that exists is the rendered page, so you take what is on the surface and clean it up yourself.

That also explains why the work feels the way it does. A scraper depends on the surface staying put, and surfaces change without warning.

Where simple scrapers go wrong

A first scraper tends to fail in a few well-known ways.

The page changes shape. Many sites use class names generated by their build tooling, and those names can change on every deploy. A selector tied to appearance breaks. One tied to meaning, such as schema.org product markup or a labelled attribute, usually survives longer.

The content is not in the HTML. Plenty of pages fill in prices or listings with JavaScript after they load, so a plain HTTP fetch returns an empty container. Rendering the page in a headless browser fixes this, at the cost of speed and memory.

The request gets blocked. A server may answer repeated requests from one address with an error or a challenge page. A script that parses the challenge page as if it were the product page will happily store nonsense, which is why checking the status code and page title before trusting the body is a sensible habit.

Those are the problems a scraping service is meant to take off your hands: rotating the address a request leaves from, running the browser for pages that need one, and sending the request from the right country when prices differ by region.

What we are building at ScrapeCat

ScrapeCat is a web scraping API from Moruk, and it is in early access. The API is not live. The examples on the home page show the planned design, and the prices are plans, not an offer you can buy today. There is a waitlist.

The idea is one HTTP request. You send a URL, optionally ask for JavaScript rendering or a country, and get back the page along with a status you can branch on. The plan is for blocked requests to be retried with a fresh address. We say plainly in the FAQ that no tool gets through every anti-bot system, and that results depend on the target site. If someone promises otherwise, be suspicious.

Some uses are off limits. Scraping has a mixed reputation partly because some of it is abusive. Hammering a site until it falls over, collecting private personal data and getting around logins you have no right to use are all off the table, and our terms will say so. Whether a particular scrape is lawful depends on what you collect, where you are and the target's rules. That is a question for a lawyer, not for a product page.

The crumbs problem

There is one more thing the old word captures. When you scrape a surface, what comes off is a thin residue, and you do not get the whole object. Scraped HTML is not the site's database. It is what the site chose to show a visitor at one moment, from one location. If you treat it as the full truth, you will be wrong in ways that are hard to see.

The leftovers are crumbs. The word is another old English one, and the spelling has a small story of its own: the final b in crumb was not there in the earlier forms and was added later, likely by analogy with other words that end in mb, though the exact reason is uncertain. The history of the word crumb covers how the spelling settled. Crumbs are still useful. Plenty of useful datasets are built from them. The thing to remember is what they came from.

A short checklist before you scrape anything

  • Check for an official API or a data export first. It will almost always be more stable than the page.
  • Read the site's terms and its robots.txt, and keep your request rate polite.
  • Prefer selectors tied to meaning over selectors tied to styling.
  • Verify the status code and page title before you parse the body, so a challenge page does not become a data point.
  • Store the date, the country and the URL with every record, because the same page can differ by all three.

None of this is exciting. It is the difference between a script that works on Tuesday and one that still works in March.