What is web scraping? How it works, what it is used for, and where proxies fit
By the ProxyOnly team · 14 Nov 2026 · 5 min read
Web scraping is automated collection of data from web pages. How it works, a working Python example, what it is used for, and where proxies fit.
Web scraping is the automated collection of data from web pages. A program requests a page the way a browser does, picks out the parts you want, such as prices, titles or listings, and saves them in a structured form like a spreadsheet or database.
It is a routine technique behind price comparison, market research, search monitoring and academic datasets. This article explains how it works, shows a complete example you can run, covers the tools and the common uses, lists the real challenges, and explains where proxies fit and where they do not.
How web scraping works
Most scrapers follow the same loop:
- Choose the pages you need and check that you are allowed to collect them.
- Request each page over HTTP, just as a browser would.
- Parse the response, which is usually HTML, to find the elements that hold your data.
- Extract the values and clean them up.
- Store the result, as a file or in a database.
- Repeat on a schedule, and watch for pages that change or start failing.
Scraping, crawling and APIs
Scraping is extracting data from pages. Crawling is following links to discover pages, which is how search engines work, and many tools do both. An API is the opposite approach: the site hands you structured data on purpose, with documented limits. If an API gives you what you need, use it, because it is more stable and clearly permitted.
A first example
This Python script requests a page from Quotes to Scrape, a sandbox site built for scraping practice, and prints the author and the start of each of the first three quotes. It needs two packages, installed with pip install requests beautifulsoup4:
import requests
from bs4 import BeautifulSoup
html = requests.get("https://quotes.toscrape.com/", timeout=20).text
soup = BeautifulSoup(html, "html.parser")
for quote in soup.select("div.quote")[:3]:
print(quote.select_one("small.author").get_text(strip=True), "|", quote.select_one("span.text").get_text(strip=True)[:48])When we ran it, it printed:
Albert Einstein | “The world as we have created it is a process of
J.K. Rowling | “It is our choices, Harry, that show what we tru
Albert Einstein | “There are only two ways to live your life. One requests fetches the page, BeautifulSoup turns the HTML into a structure you can query, and select finds elements with CSS selectors. The same pattern collects any data that is present in a page's HTML.
Going further: several pages into a file
Real jobs cover many pages and save the results. This version walks the first three pages, identifies itself in the user agent, and writes a CSV file:
import csv, requests
from bs4 import BeautifulSoup
session = requests.Session()
session.headers["User-Agent"] = "my-research-bot/1.0 (contact: you@example.com)"
rows = []
for page in range(1, 4):
response = session.get(f"https://quotes.toscrape.com/page/{page}/", timeout=20)
soup = BeautifulSoup(response.text, "html.parser")
for quote in soup.select("div.quote"):
rows.append({"text": quote.select_one("span.text").get_text(strip=True), "author": quote.select_one("small.author").get_text(strip=True)})
with open("quotes.csv", "w", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=["text", "author"])
writer.writeheader()
writer.writerows(rows)
print(len(rows), "rows")This printed 30 rows in our test. On a real site you would also add a pause between requests, as described in rate limiting explained.
Static pages and JavaScript pages
The examples above work because the data is in the HTML the server sends. Many modern sites load their data afterwards with JavaScript, so the HTML you fetch is nearly empty. You have two options:
- Find the data source. Open your browser's developer tools, watch the network tab while the page loads, and look for the request that returns the data, often as JSON. Calling it directly is faster, lighter and more stable than parsing the page.
- Use a real browser. Tools such as Playwright, Puppeteer and Selenium load the page, run its JavaScript and let you read the result. They are heavier, and they move far more traffic, which matters if you pay per gigabyte.
Common tools
- Requests with BeautifulSoup, as above, for simple pages. See the BeautifulSoup guide.
- Scrapy, a framework for large crawls, with queues, retries and pipelines built in. See the Scrapy guide.
- Playwright, Puppeteer and Selenium for pages that need a browser. See Playwright for Python and Selenium.
- Crawlee, a Node.js library for crawling and browser automation. See the Crawlee guide.
- No-code scraping tools, for people who do not want to write code.
What web scraping is used for
- Tracking prices and availability across retailers, as in price monitoring.
- Market and competitor research, covered in competitor analysis.
- Monitoring search results and content for SEO, as in the SEO use case.
- Aggregating listings for travel, real estate and jobs.
- Building datasets for academic and public-interest research.
- Checking ads and brand use, as in ad verification and brand protection.
The challenges
- Pages change. A redesign breaks your selectors, so scrapers need monitoring.
- Sites limit and block. Rate limits, challenges and blocks are normal, and why websites block IPs and proxies explains the signals.
- Dynamic content needs a browser or a different approach.
- Data quality needs work: duplicates, missing values, inconsistent formats.
- The rules. What you may collect, and how, is a legal and ethical question as well as a technical one. Is web scraping legal covers it.
Where proxies fit
A proxy changes the address your requests come from. That helps in two situations: you need to see a page as a visitor in another country sees it, or you need to spread a large number of requests over several addresses so that no single address exceeds a site's limits. It is not needed for small, polite jobs, and it does not give you permission to ignore a site's limits or terms. Proxies for web scraping covers which type to use and how many addresses a job needs, and what is a proxy server covers the basics.
Scrape responsibly
- Prefer an official API or data feed when one exists.
- Read the site's terms and its
robots.txtfile. - Go slowly, honour
429responses, and keep the load small. - Identify yourself with a clear user agent and a contact address when you can.
- Avoid collecting personal data unless you have a lawful reason, and store only what you need.
- Cache what you have already fetched, so you do not ask for it twice.
Try it yourself
Create an account, add funds from US$1 and order a proxy in the country you need.
Keep reading
25 Nov 2026 · Web scraping
Web scraping API vs proxies vs building it yourself
Scraping API, raw proxies, or your own stack. What each actually costs, what you give up, and the cases where we would tell you to buy the API instead.
25 Nov 2026 · Web scraping
Python web scraping tutorial: from first request to a polite crawler
A working Python scraper built in stages: one request, parsing, following pagination, error handling, and the manners that keep a crawler running.