
Web scraping means using a program to download web pages and extract data from them automatically: prices, job ads, timetables, research data. The technique itself is legal in most countries. What can make a project unlawful or unethical is what you collect, how you collect it and what you do with it. This guide is general information, not legal advice: laws differ between countries, so ask a lawyer about commercial or large projects.
Automated crawlers are almost as old as the web. In 1994, after early bots overloaded small servers, Dutch engineer Martijn Koster proposed robots.txt, a text file where site owners tell bots which paths to avoid. It worked for decades as an informal convention and was finally published as an internet standard, RFC 9309, in 2022. Courts have since heard many scraping disputes, most famously hiQ Labs v. LinkedIn in the United States (2017–2022). Since 2023, AI training crawlers have made the topic more heated, and many sites now block them.
First check whether the data is already offered in a cleaner form. Many services provide an API (application programming interface) that returns structured data such as JSON, with clear usage rules. Governments and research projects often publish open datasets. An API is usually more reliable than parsing HTML, which breaks when a site's design changes, and its terms say exactly what is allowed.
Open https://example.com/robots.txt in a browser. You will see rules like these:
robots.txt is a request, not a lock, and its legal weight varies, but ignoring it is a clear sign of bad faith. Also read the site's terms of use. Many forbid automated access or commercial reuse, and if you create an account and accept them, you may be bound by them as a contract. Never scrape content behind a login, a paywall or a CAPTCHA you had to get around.
Several areas of law can apply at once:
The EU also allows text and data mining for research, but commercial miners must respect a site's machine-readable opt-out, which robots.txt often provides.
A careless scraper can slow a small site down or even take it offline. Treat the server as if you paid for it:
Python's standard library can read robots.txt for you. With the popular requests and beautifulsoup4 packages installed, the core steps look like this:
For larger projects, the Scrapy framework can obey robots.txt, throttle speed and cache responses for you.
Names, photos, email addresses and profile details remain personal data even when anyone can see them online. Under the GDPR you need a lawful basis for collecting them, must collect only what your purpose requires, keep them secure and delete them when you are done. Regulators have fined companies that built databases of scraped faces. The safest approach is to avoid personal data entirely, or to remove or anonymise it as soon as you collect it.
Typical errors include assuming that "public" means "free to use", hammering a site with parallel requests, hiding behind rotating proxies to dodge blocks, and republishing scraped articles as your own. Before you run any scraper, ask yourself:
If an answer makes you uneasy, email the site owner. Many happily share data with people who ask politely.
Grade 10 Math: Functions and Reasoning - Quiz
1170 questions