Web scraping for business: how it works and how to do it responsibly
What web scraping is, how a scraper turns web pages into a spreadsheet, what businesses use it for, and the legal and ethical points to check before you start.
A lot of useful business information is published on websites: company listings, prices, product details, property listings, job postings, reviews. Reading it by hand works for ten records and fails at ten thousand. Web scraping is how that information is collected automatically and turned into a structured file you can filter, analyze or import.
This guide explains how scraping works, what it is used for, when another approach is better, and what to check before you start, including the legal side.
In short
- Web scraping uses software to read web pages and copy specific details into rows and columns.
- A good project starts with the decision the data will support, then the fields, sources, volume and how often it should repeat.
- Check for an official API or a ready-made dataset first. They are often simpler and more stable.
- Public data is not automatically free to use. Check the site's terms and robots.txt, avoid personal data you do not need, and never get around logins or other access barriers.
What web scraping is
Web scraping (also called data extraction or crawling) means using a program to visit web pages, find specific pieces of information on them, and save that information in a structured format such as a spreadsheet, a database table or a JSON file.
A person reading a business directory sees a page of listings. A scraper sees the same page as code, finds each listing's name, category, address, phone number and website, and writes them out as one row per business. Repeated across thousands of pages, that becomes a dataset.
How a scraper works, step by step
- Choose the pages. Start from a list of addresses, a site's sitemap, category pages or search results. This step decides how complete the data will be.
- Fetch each page. The scraper requests the page, as a browser would. Some sites build their pages with JavaScript after loading, so the scraper has to run a real browser in the background to see the content.
- Find the data. The scraper locates each field in the page's structure (for example, "the text inside the element marked as the price"). Many sites also include structured data in the page that is easier to read reliably.
- Clean and structure it. Raw values are rarely ready to use. Prices need a currency, phone numbers a consistent format and addresses splitting into parts, and duplicates have to be removed.
- Check it. Compare a sample against the live pages, look for empty or odd values, and count records against what the site shows.
- Deliver and repeat. Save the result as CSV, Excel, JSON or straight into a database or CRM, and schedule the next run if the data needs to stay current.
Websites change their layout without warning, so scrapers that run regularly need monitoring. A change that breaks one field should be noticed before it reaches your reports.
What businesses use it for
| Use | Typical data | Who uses it |
|---|---|---|
| Lead generation | Business names, categories, phone numbers, websites, locations | Sales and marketing teams |
| Price and product monitoring | Prices, stock status, product details, sellers | Retailers, brands, marketplaces |
| Market research | Listings, ratings, review counts, categories | Analysts, consultants, founders |
| Real estate | Listings, prices, property details, agents | Agents, investors, property platforms |
| Jobs data | Job titles, companies, locations, posting dates | Recruiters, HR and labor market analysts |
| Monitoring | News, announcements, changes to public pages | Communications, compliance and research teams |
Scraping, an API or a ready-made dataset?
Scraping is not always the best route. Before you start, check whether one of these fits better:
| Option | Good when | Watch out for |
|---|---|---|
| Official API | The site offers one with the fields you need | Usage limits, costs and fields that are missing from the API |
| Ready-made dataset | The data is common and does not need to be current to the day | Age of the data, coverage and licence terms |
| Web scraping | The data is public, but there is no API or dataset that fits | Site terms, layout changes and data protection rules |
| Manual research | You need a few hundred records with judgment applied | Time and cost per record |
Many projects combine them: a dataset as the base, scraping to fill gaps or keep it current, and manual research for the records that need a person to check them.
The legal and ethical side
Whether a particular scraping project is lawful depends on the country, the site, the data and what you do with it. The points below are general background, not legal advice.
Public pages and access rules
In the United States, two court cases are often cited. In hiQ Labs v. LinkedIn, the Ninth Circuit, upholding a preliminary injunction in April 2022, found that the "without authorization" part of the Computer Fraud and Abuse Act likely does not apply to data on public websites. The case did not end there: later in 2022 the district court found that LinkedIn's user agreement, which bans scraping and fake profiles, could be enforced as a contract, and the parties settled in December 2022 with a judgment against hiQ.
In Meta Platforms v. Bright Data, a federal court in California ruled in January 2024 that Bright Data did not breach Meta's terms by scraping public data while logged out, because the terms, as the court read them, covered people using Facebook and Instagram, not logged-off visitors.
The lesson from both: what is publicly visible and what a site's terms allow are separate questions, and logging in usually means accepting terms that may forbid scraping. Collecting data behind a login, or getting around technical barriers such as CAPTCHAs, carries much more risk.
robots.txt
Most websites publish a robots.txt file that tells automated visitors which parts of the site they may crawl. The rules were standardized as RFC 9309 in September 2022. The standard itself says the rules "are not a form of access authorization", so they do not decide on their own what is legal. Respecting them is still the norm for responsible crawlers, and ignoring them is hard to defend if a site owner complains.
Copyright and database rights
Facts on their own are generally not protected by copyright in the United States; the Supreme Court said so in Feist v. Rural Telephone (1991), a case about a telephone directory. Text, photos and the creative way information is presented can be protected, though, so copying descriptions or images is different from collecting names and prices. In the European Union, the Database Directive gives a separate right to the makers of databases that took substantial investment, which can restrict extracting the whole or a substantial part of a database.
Personal data
Publicly visible personal data is still personal data. In August 2023, twelve data protection authorities, including the UK's ICO and the Canadian and Australian privacy regulators, issued a joint statement on scraping. The ICO's summary puts it plainly: organizations "must have a lawful reason for collecting and using people's data, even when it is publicly available." Under the GDPR, if you collect personal data about someone from another source, you must also tell them, at the latest when you first contact them.
For business data, that means: collect company-level information where you can, collect only the personal details you need (such as a business contact's name, role and work email), and act on removal requests.
A responsible scraping checklist
- Read the site's terms of use and its robots.txt before starting.
- Do not log in to collect data, and do not get around CAPTCHAs, paywalls or other access barriers.
- Keep request rates low, so the site is not slowed down for its users.
- Collect only the fields you need, and avoid personal data you will not use.
- Do not republish copyrighted text or images.
- Record the source and the collection date for every record.
- Honor removal and opt-out requests, and keep a list of them.
Questions to answer before you start
Clear answers to these make a scraping project faster to scope, and the result easier to use:
- What decision will the data support? "Find clinics to call" leads to different fields than "track competitor prices".
- Which fields do you need, and which are only nice to have?
- Which sites, and are there official APIs or datasets for them?
- How many records, roughly, and for which countries or categories?
- How often should the data be refreshed: once, weekly, daily?
- What format do you need: Excel, CSV, JSON, or straight into your CRM or database?
- What happens to the data next, and do any data protection rules apply to it?
If you have a project in mind, send us a brief with the sites and fields you need, and we will reply with questions or a scope.
Sources
- hiQ v. LinkedIn: landmark data scraping suit provides guidance to data scrapers and web operators, Morgan Lewis, December 2022
- Major decision affects law of scraping and online data collection: Meta Platforms v. Bright Data, Farella Braun + Martel
- RFC 9309: Robots Exclusion Protocol, IETF, September 2022
- Feist Publications, Inc. v. Rural Telephone Service Co., 499 U.S. 340 (1991), Legal Information Institute
- Directive 96/9/EC on the legal protection of databases, EUR-Lex
- Joint statement on data scraping and data protection, Information Commissioner's Office, 24 August 2023
- Article 14 GDPR