# Web scraping

> Web scraping is the automated collection of data from websites, where a program loads pages, reads their content and saves the fields it needs, such as prices, listings or contact details, into a structured dataset.

Also called: scraping, web crawling, data scraping, web data extraction. Category: Data and retrieval. Source: https://aibuildindex.com/glossary/web-scraping

## In the index

- AI-assisted web scraping: median $900, middle half $200 to $3,700, 276 priced briefs (https://aibuildindex.com/cost/web-scraping-ai)
- Data scraping: median $1,300, middle half $300 to $5,000, 1,779 priced briefs (https://aibuildindex.com/skills/data-scraping)
- Scrapy: median $1,360, middle half $180 to $4,800, 103 priced briefs (https://aibuildindex.com/skills/scrapy)

When the data a business needs is on public web pages rather than behind an API, web scraping is how it gets collected at scale. Typical uses include competitor price monitoring, building lead lists from directories, tracking product reviews and collecting listings for property or job aggregators. Adding AI to a scraper mostly helps with the reading step: a language model can pull clean fields out of messy, inconsistent pages that would break a fixed parser.

## How it works

A scraper has three parts. A crawler decides which URLs to visit, following links or working from a list. A fetcher downloads each page; simple sites return their content in plain HTML, while sites built with heavy JavaScript need a real browser driven by tools such as Playwright or Puppeteer ([browser automation](https://aibuildindex.com/glossary/browser-automation)). A parser then reads the page and pulls out the fields, either with selectors that target specific HTML elements or with a model doing [data extraction](https://aibuildindex.com/glossary/data-extraction).

Around that core sits the operational work that decides whether a scraper survives: rate limiting so the target site is not overloaded, retries for failed pages, proxy rotation where sites block repeated requests, deduplication, and a [scheduled job](https://aibuildindex.com/glossary/scheduled-job) to rerun the collection daily or weekly. The output usually lands in a spreadsheet, database or [data pipeline](https://aibuildindex.com/glossary/data-pipeline).

## What it means for cost

Scraping quotes vary widely because the hard part is the target sites, not the code. Points to clarify before asking for a price:

- **How many sites, and how different they are.** One well-structured site is quick; fifty sites with different layouts each need their own handling, or an AI extraction layer.
- **Anti-bot measures.** Logins, CAPTCHAs and aggressive blocking add proxies, browser automation and ongoing running costs.
- **Freshness.** A one-off export is a small job; a feed that must stay current needs monitoring and maintenance.

Scrapers break when target sites change their layout, so budget for maintenance from the start and ask the builder how breakage will be detected. Live figures are on the [web scraping cost page](https://aibuildindex.com/cost/web-scraping-ai).

## Legal and ethical limits

Whether scraping a given site is allowed depends on the site's terms, the jurisdiction and the kind of data. Collecting [personal data](https://aibuildindex.com/glossary/personal-data) brings data protection law into play even when the pages are public. This is not legal advice; a buyer planning to scrape personal or copyrighted material should get proper advice first.

## Common questions

### Is web scraping legal?

Scraping publicly available, non-personal data is common practice, but legality varies by country, by the site's terms of use and by what is done with the data. Personal data and content behind a login carry more risk. Check before building, not after.

### Why do scrapers need so much maintenance?

Websites change their layout, page structure and blocking rules without notice, and a scraper that relied on the old structure silently stops returning data. Monitoring for empty or malformed results is the only reliable way to catch this quickly.

## Related terms

- [Browser automation](https://aibuildindex.com/glossary/browser-automation): Browser automation is software controlling a web browser the way a person would, opening pages, clicking, typing and downloading, so that repetitive tasks in websites without an API can run on their own.
- [Data extraction](https://aibuildindex.com/glossary/data-extraction): Data extraction is the process of pulling specific fields or records out of unstructured or semi-structured sources, such as documents, emails, web pages or transcripts, and returning them in a consistent, structured format.
- [Data pipeline](https://aibuildindex.com/glossary/data-pipeline): A data pipeline is an automated series of steps that moves data from one or more sources to a destination, transforming, checking and enriching it along the way, on a schedule or as new data arrives.
- [Scheduled job (cron)](https://aibuildindex.com/glossary/scheduled-job): A scheduled job is a task that a system runs automatically at set times or intervals, such as every hour or each weekday at six, often defined with a cron expression; it is the simplest way to start an automation without a person.
- [Data cleaning](https://aibuildindex.com/glossary/data-cleaning): Data cleaning is the work of finding and fixing errors, duplicates, gaps and inconsistencies in a dataset, such as mismatched formats or misspelt names, so that reports, automations and AI models built on it give reliable results.
- [Personal data (PII)](https://aibuildindex.com/glossary/personal-data): Personal data is any information that relates to an identifiable living person, such as a name, email address, phone number, location or customer ID; in the US it is often called personally identifiable information, or PII, and its handling is governed by data protection law.
