What Is Data Scraping? Web Scraping Explained (2026 Guide)
Data scraping is the automated extraction of data from websites. How the fetch-parse-store pipeline works, what it powers, and the legal lines in 2026.

On this page
The day I drafted this, Hacker News’s front page carried a story titled “Business accounts will consent to Meta scraping their websites.” Not a hack, not a leak: a terms-of-service update about routine data scraping, one link away from a story about an AI model release. Automated data collection has stopped being a niche engineering topic. Imperva’s 2026 Bad Bot Report puts automated traffic at more than half of all web traffic in 2025, and a chunk of it is someone’s data pipeline.
This page is the plain-English version of data scraping: what it is, how the pipeline actually works when you run it, what people do with the results, what it costs, and where the legal lines sit in 2026. I’ll run a real scraper on a real page so you can see every stage with numbers attached.
On this page: the one-minute version · what data scraping actually is · the process, stage by stage · database scraping · use cases · the 2026 tool stack · getting blocked · the legal lines · common mistakes · where to go next · FAQ
Explain web scraping in one minute
Data scraping is the automated extraction of data from a source that wasn’t designed to hand it over: a website, an app, a PDF, a legacy terminal screen. Web scraping is the same thing when the source is a web page. You point a program at a URL, the program downloads the HTML, pulls out the fields you want (product names, prices, article text), and writes them to a file or database you can actually query.
The one-sentence version: a scraper is a robot that reads pages the way you read them and types the interesting parts into a spreadsheet, about a thousand times faster.
| Term | Plain meaning |
|---|---|
| Data scraping | Extracting structured data from any source: web, apps, documents, old systems |
| Web scraping | Data scraping where the source is a website |
| Crawler / spider | Follows links to discover pages; a scraper then extracts from them |
| Parser | Code that turns HTML text into a navigable structure (a tree of tags) |
| Headless browser | A real browser without the window, used when pages need JavaScript to show their data |
| robots.txt | A file where a site states which bots may request what, and how fast |
| Anti-bot system | Software (Cloudflare, Akamai, DataDome) that tries to tell bots from humans |
Everything else on this page is these seven rows, unpacked.
What data scraping actually is
Copy-paste from a web page into Excel is data scraping with your fingers. Paste a hundred pages a day and you’ve reinvented the RSI that produced the first scrapers. A scraper is just that loop, automated: request a page, select the fields, write the rows, move to the next URL.
The definition worth memorizing: data scraping converts content that is displayed for humans into data that is structured for machines. A price on a store page is typography. A price in a CSV column is data. Scraping is the conversion between the two.
That conversion has been around longer than the web. “Screen scraping” dates to the 1980s, when programs read text off mainframe terminal screens that had no other export path. The term survived because the problem survived: useful data locked inside an interface built for looking, not for querying. We cover the modern web flavor of it in what is screen scraping, and the broader discipline of turning documents and pages into structured records in what is data extraction.
Data scraping vs. web scraping
Vendors and blogs use the two phrases loosely, but the honest split is by source. Data scraping is the umbrella: scraping a desktop app’s lists, a PDF invoice, a stock ticker terminal, a website. Web scraping is the largest, loudest subset, and in 2026 it’s where nearly all the attention, tools, and legal arguments live. When a marketer says “data scraping,” they almost always mean web pages.
Two practical consequences of the split. First, tooling: web scraping needs HTTP clients and HTML parsers, while scraping a PDF needs layout analysis. Different problem, different tools. Second, permission: scraping your own bank’s export screen and scraping someone else’s website live under very different rules. The legality section below is about the web flavor.
The “data web scraping” mashup
Search for this topic and you’ll meet the heading above and its cousins: “data web scraper,” “web data scraping.” They’re not a distinct technique; they’re what happens when two popular keywords collide in a search box. If a page about “data web scraping” describes requesting pages and extracting fields, it’s describing plain web scraping with the word order scrambled.
Webscraping, web scraping, web-scraping
Same story with spelling. “Webscraping” (one word), “web scraping” (two), and “web-scraping” (hyphenated) all name the same practice. Search engines treat them as near-identical; style guides settled on two words. I use the two-word form here, and I won’t correct your codebase for spelling it differently. Mine does too.
The process of web scraping, stage by stage
Every scraper ever written is four stages: fetch, parse, extract, store. The delicate engineering is rarely in stage one; it’s in stages two through four, where reality bites. Here’s the whole loop, run for real.
The web scraping process in code: a real run
The target: Hacker News’s front page, 30 story links, scraped with nothing but Python’s standard library: no packages, no browser, one file. Fetched 2026-10-16, from a home connection.
import urllib.request, csv, time
from html.parser import HTMLParser
t0 = time.perf_counter()
req = urllib.request.Request("https://news.ycombinator.com/",
headers={"User-Agent": "demo-scraper/1.0 (learning project)"})
html = urllib.request.urlopen(req, timeout=15).read().decode("utf-8", "replace")
t_fetch = time.perf_counter() - t0
class Titles(HTMLParser):
def __init__(self):
super().__init__()
self.rows, self.in_title, self.cur = [], False, None
def handle_starttag(self, tag, attrs):
a = dict(attrs)
if tag == "span" and a.get("class") == "titleline":
self.in_title, self.cur = True, {}
elif tag == "a" and self.in_title and "url" not in self.cur:
self.cur["url"] = a.get("href", "")
def handle_endtag(self, tag):
if tag == "span" and self.in_title and self.cur:
self.rows.append(self.cur); self.in_title, self.cur = False, None
def handle_data(self, data):
if self.in_title and self.cur is not None:
self.cur["title"] = (self.cur.get("title", "") + data).strip()
t0 = time.perf_counter()
p = Titles(); p.feed(html)
with open("hn_titles.csv", "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=["title", "url"])
w.writeheader(); w.writerows(p.rows)
print(f"fetch {t_fetch*1000:.0f} ms, {len(html):,} chars | "
f"parse {len(p.rows)} rows in {(time.perf_counter()-t0)*1000:.0f} ms")
Measured output, abridged:
fetch 1647 ms, 34,530 chars | parse 30 rows in 12 ms
'Muse Spark Open (meta.ai' -> https://research.meta.ai/blog/muse-spark-open
'Business accounts will consent to Meta scraping their websites …' -> https://www.niemanlab.org/2026/10/...
Thirty rows land in hn_titles.csv. Total elapsed time: about 1.7
seconds, of which 1.65 is the network and 12 milliseconds is the
parsing. That ratio is the first lesson of the web scraping process:
the network dominates. Everything you do to be polite (delays,
retries, backoff) happens on the fetch side, and it’s where a scraper’s
runtime actually goes.
Second lesson, learned the embarrassing way: my first version of that
parser captured the wrong link. HN puts a second link (the story’s
hostname) inside the same titleline span. My code let every <a>
overwrite the URL field, so all 30 rows came back holding the hostname
link (from?site=polygon.com) instead of the story URL. The
CSV looked perfectly plausible. I caught it
only by reading the output, which is the real rule: never
trust a scraper’s first run; eyeball ten rows before you store ten
thousand.
When HTML isn’t the data
That demo worked because HN is a 1990s-style page: the content is in
the HTML. A growing share of the web isn’t. Case study, measured the
same hour: quotes.toscrape.com/js/, a practice site built to teach
exactly this lesson.
GET https://quotes.toscrape.com/js/
200 OK, 5,808 bytes
quotes visible in HTML elements: 0
quotes inside <script> payload: 12
The page is a shell. The quotes live in a JavaScript array inside a
<script> tag, injected after load. A regex over the HTML finds
nothing, because the HTML is not the data — the rendered page is.
Your options, cheapest first:
- Read the script payload directly. The data is right there as JSON-ish JavaScript. Often the fastest path and the most brittle.
- Call the underlying API. Open the browser dev-tools Network tab, find the XHR that carries the data, and request that endpoint. When the site offers one, this beats scraping HTML entirely; see web scraping vs API for that decision.
- Run a headless browser (a real Chromium without a window), let the JavaScript execute, then extract from the rendered DOM. It’s the heavy option (hundreds of megabytes of RAM per instance, seconds per page) but it works on almost anything. The mechanics live in what is a scraping browser, the fundamentals in what is a headless browser, and the full escalation ladder in how to scrape dynamic websites.
This fetch-cheap-first-then-render decision is the single biggest cost lever in production scraping. Rendering 100,000 pages in a browser farm costs real money; the same pages over plain HTTP cost fractions of a cent.
What a database scraper actually does
“Database scraper” usually means one of two things: a scraper that writes into a database instead of a file, or a tool that scrapes an actual database-backed website at scale. The first is a storage decision, and it’s worth getting right early.
CSV and JSON are fine until they aren’t. CSV has no types (is "001"
a string or a number?), no schema enforcement, and collapses the moment
two people edit it in parallel. The usual progression:
- Under a few thousand rows, one-off: CSV. Boring and correct.
- Recurring runs, changing data: SQLite. A single file, real types, real queries, zero setup. Most good scrapers (and every serious framework) land here by default.
- Multiple writers, big volume, dashboards downstream: Postgres, loaded by the scraper or by a pipeline that watches its output.
Two schema decisions bite everyone eventually. First, dedupe keys:
decide before the second run what makes a row “the same row”: a
product SKU, an article URL, a composite of fields. Without one, your
third daily run triples the table. Second, timestamps: store
scraped_at on every row, because you will eventually want to know
what the data looked like on a given day, and that history is
unrecoverable once it’s gone. Price history, for instance, is only
scrapable forward.
If your real destination is Excel or Google Sheets rather than a database, the mechanics live in import website data to Excel and Google Sheets web scraping: same pipeline, friendlier last stage.
What the data is used for
Ask what data scraping is for and the honest answer is: anything a decision that depends on “what does the world currently look like.” The use cases with real money behind them:
- Price and assortment monitoring. Retailers track competitors’ prices and reprice daily; marketplaces police unauthorized sellers. This is the oldest at-scale use case and still the largest commercial one.
- AI training and evaluation. The 2023–2026 wave turned crawlers from a niche tool into internet infrastructure. GPTBot, OpenAI’s crawler, launched in August 2023; since then, model builders scrape and license web text at a scale that has reshaped the whole blocking landscape (more on that below). How the crawlers work: AI web crawlers explained.
- Lead generation and sales intelligence. Public directories, company sites, job boards, assembled into contact and account lists. Also the use case with the sharpest personal-data edge; see GDPR below.
- Market and academic research. Economists now routinely scrape prices and listings for inflation research; political scientists scrape social platforms. When a journal paper’s appendix says “data collected via custom scraper,” this is what it means.
- Change monitoring. Watch a page, get notified when it changes: compliance pages, competitors’ changelogs, court dockets, “back in stock.”
Notice what’s absent: scraping for scraping’s sake. Every durable scraping operation I’ve seen started from a question (“what does our competitor charge in Germany?”) and built the smallest pipeline that answers it. The projects that die are the ones that scrape first and ask questions later.
The web scraping technology stack in 2026
The tools sort into six categories. Which one fits depends on volume, JavaScript, and how much you want to write vs. click.
| Category | Examples | You write code? | Cost shape |
|---|---|---|---|
| HTTP + parser libraries | Python requests + BeautifulSoup / lxml |
Yes, lots of control | Free |
| Frameworks | Scrapy (Python), Crawlee (Node/Python) | Yes, batteries included | Free, open source |
| Headless browsers | Playwright, Puppeteer, Rod | Yes | Free; your RAM pays |
| Point-and-click desktop | Octoparse, ParseHub | No | Free tier + subscription |
| Hosted scraping APIs | Firecrawl, Apify, ScraperAPI | Little or some | Per page/credit |
| Local-first CLI/desktop | Magpie | Little | Free core; desktop app has a trial then a license |
A tour that actually holds up in 2026:
Libraries and frameworks are where every engineer starts.
requests plus BeautifulSoup reproduces my HN demo with friendlier
syntax; Scrapy adds concurrency, retries, pipelines, and middleware in
exchange for a framework-shaped learning curve. Free, transparent, and
you own every bug.
Headless browsers are the price of the JavaScript web. Playwright drives a real Chromium: it can click, fill forms, wait for content, and capture the XHR traffic. It does almost anything. Slowly.
Point-and-click tools (Octoparse, ParseHub, Browse AI and friends) trade control for speed-to-first-data. They shine on repeatable list-type pages and choke on login walls and aggressive anti-bot; the subscriptions add up. We’ve reviewed several honestly, starting with ParseHub and Browse AI.
Hosted APIs (Firecrawl, Apify, ScraperAPI) sell you their proxy pools, browser farms, and unblocking expertise by the credit. You trade money and data custody for not operating infrastructure. What Firecrawl actually returns for the price is a fair sample of the category.
Local-first tools are the smallest category and the one I keep returning to. Magpie, the one I build with, is a single binary: it fetches, cleans to Markdown or JSON, and stores locally, with robots.txt respected and automatic throttling, under an AGPL/commercial dual license. The pitch is custody: the data never leaves your machine. For a full tour by category, see best web scraping tools.
None of these bypass CAPTCHAs or logins-for-paywalled content, whatever their marketing implies. What they sell is reliability, not trespass.
Getting blocked: the arms race you’re joining
Here’s the part every beginner tutorial skips. The moment your scraper leaves practice sites, it competes with every other bot for every site’s patience — and the sites have organized.
The numbers first. Imperva’s 2026 Bad Bot Report measures automated traffic at over half of all web traffic in 2025 (53%, up from 51% the year before). Sites responded with defenses that profile every visitor: TLS fingerprints, JavaScript challenges, behavioral analysis. Cloudflare alone fronts enough of the web that its policies are web-scale policy. In July 2025 it made AI-crawler blocking the default for new customers, with a pay-per-crawl model behind it. The message to scrapers: the free-and-unguarded web of 2015 is not coming back.
Against that backdrop, the boring virtues win:
Read robots.txt. It’s the site’s published terms for bots. Real
example, fetched for this article: news.ycombinator.com/robots.txt
asks, in its entirety, for Crawl-delay: 30 and disallows action
endpoints like /vote and /reply. That’s not a legal document; it’s
a request. Honoring it is both the polite move and, in a growing
number of court-adjacent arguments, the defensible one. The details:
robots.txt and web scraping.
Identify yourself. A User-Agent string that says who you are (like
my demo’s demo-scraper/1.0) gets you blocked from sites that don’t
want you. A fake browser UA gets you served. Until the TLS
fingerprint doesn’t match, at which point you’re blocked anyway and
now you’re also lying. I’ve been on both sides of that trade; honesty
ages better.
Rate-limit like a guest. One request per second per host is a
decent default; respect Retry-After headers; back off on 429s. A
crawled site that barely notices you is a crawled site that never
bans you. The full playbook:
how to scrape without getting blocked,
web scraping bots, and
web scraping best practices.
None of this defeats a determined anti-bot vendor, and tools that advertise exactly that are selling an escalation you don’t want to own.
Where the law actually lands
The short version, not legal advice: scraping public data is largely permitted in the US, contested everywhere personal data appears, and negotiable everywhere a contract says so.
Three anchors, roughly in order of how often they matter. First, the Computer Fraud and Abuse Act has narrowed: the Supreme Court’s Van Buren decision (2021) and the hiQ v. LinkedIn line of cases pushed “accessing a public website” out of “unauthorized access” territory. And hiQ ultimately settled in 2022 with LinkedIn rather than winning clean. Second, contract law: in May 2024 a jury found Bright Data did not breach Amazon’s terms by scraping public Amazon pages. But terms of service still bind you if you logged in or clicked agree, which is where most scrapers get caught. Third, privacy law: GDPR and its cousins apply to personal data however it was collected, and “it was public” is not a safe harbor.
Practical reading: public data, no login, no personal data, honor robots.txt: that’s the low-risk quadrant. Anything past those lines, read the specifics: is web scraping legal for the full map, the CFAA after Van Buren for the criminal-law edge, GDPR and scraping for personal data, and terms of service for the contract trap. If the stakes are real, a lawyer reads it before you ship, not after.
Four mistakes that end most first scrapers
- Trusting the first run. Covered above. My HN parser looked right and stored a wrong link on all 30 rows. Eyeball output every time the site or the selector changes.
- Hardcoding structure. CSS paths copied from dev-tools are the most brittle thing you can ship; one redesign and they’re mulch. Prefer stable anchors (IDs, semantic tags, embedded JSON) over positional paths, and expect to fix selectors eventually. A selector will break. Plan for the day.
- Scraping what an API already offers. Before building the pipeline, check for an official API, a public dataset, or an export button. An hour with the official route beats weeks of mopping up breakage.
- No footprint control. Unlimited concurrency, no delays, no caching: a first-time scraper that requests 50 URLs a second looks exactly like an attack, gets exactly that response, and earns the site-wide ban that outlives the project.
Where to go from here
If you want one next action: pick a practice target and run the 40-line parser above against it tonight. The sandbox list in websites to practice web scraping exists so your first selectors break on sites built to be broken, not on someone’s production store.
When you outgrow the demo, the two directions are how to scrape data from a website with a real toolchain, and the hub map: definitions in the Learn cluster, deep dives in the Guides, honest tool reviews in Alternatives. This page is the front door.
FAQ
What is data scraping used for? Price monitoring, AI training data, lead generation, academic research, and change monitoring are the big five. Common thread: a recurring question about current, public, page-displayed information that no official export answers.
Is data scraping the same as web scraping? Not quite. Web scraping is data scraping from websites specifically. Data scraping is the umbrella term that also covers apps, PDFs, and legacy systems. In everyday use the phrases are near-synonyms.
Is web scraping legal? Scraping publicly accessible data is broadly permitted in the US; login-walled content, personal data (GDPR), and sites whose terms you accepted are where the risk concentrates. Jurisdictions differ. Not legal advice; start with the full legality guide.
Can websites block scrapers? Yes, aggressively. Over half of all web traffic is now automated, and defenses (Cloudflare, Akamai, DataDome) profile TLS, JavaScript, and behavior. Polite, slow, identified scrapers with real use cases survive; blunt ones don’t.
Do I need to know how to code? No. Point-and-click tools and hosted services cover simple list-page extraction. You’ll want code the moment you need logins, pagination logic, scheduling, or custom cleaning, which is most production work.


