# 12 Python Web Scraping Libraries Compared: Parse Speeds We Measured, 2026 Version Traps and the Proxy Setup for Each

Published 2026-12-05 · By Team CleanProxies · [Read on the web](https://www.cleanproxies.com/blogs/python-web-scraping-libraries)

> Python web scraping libraries compared (versions read on PyPI 5 Dec 2026): Requests, HTTPX, aiohttp, curl_cffi, BeautifulSoup, lxml, parsel, selectolax, Scrapy, Playwright, Selenium, Crawl4AI. Our parse timings, three version traps and a proxy snippet for each.

The best Python web scraping libraries in 2026 are Requests or HTTPX to download pages, BeautifulSoup, lxml, parsel or selectolax to parse them, Scrapy for crawls of thousands of pages, and Playwright when a page only renders in a browser. CleanProxies adds the IPs those libraries send from: rotating residential proxies as low as $0.63/GB and dedicated static ISP proxies as low as $0.75/IP, and every fetch and browser library below takes a CleanProxies proxy line in one or two lines of code.

**[Get proxies for your Python scraper →](https://www.cleanproxies.com/products/rotating-residential-proxies)** · Running 100+ static IPs or reselling? Volume pricing drops on its own, and the bulk and reseller options are covered near the end.

*Updated 5 December 2026. Library versions and release dates were read on PyPI on 5 December 2026. The parser timings, page sizes and the Scrapy run below come from scripts we ran that day; the commands and their output are in the post.*

## TL;DR

- **Most scrapers need two libraries, not one:** an HTTP client (Requests, HTTPX, curl_cffi) that downloads the HTML, and a parser (BeautifulSoup, lxml, parsel, selectolax) that pulls the data out.
- **Beginners:** Requests + BeautifulSoup. BeautifulSoup was the slowest parser we timed, but it is the easiest to read and debug.
- **Speed:** parsing the same 50 KB page, selectolax took 0.59 ms and lxml 1.52 ms against 23.92 ms for BeautifulSoup with Python's built-in parser (our run, 5 Dec 2026).
- **Big crawls:** Scrapy gives you queues, retries, throttling, pipelines and per-request proxies out of the box.
- **JavaScript-heavy sites:** Playwright first, Selenium if your team already uses it. Both cost far more bandwidth per page than an HTTP client.
- **Three version traps in 2026:** HTTPX no longer accepts `proxies=` (removed in 0.28, still gone in 0.29: use `proxy=`), selectolax 1.0 removed its old `selectolax.parser` engine (import `selectolax.lexbor`), and Scrapy 2.20 spiders start from `async def start()`, not `start_requests()`. We checked all three in our own environment.
- **Swapping libraries rarely fixes blocks; the IP and the request rate are common causes.** Rotating residential IPs for spread-out page fetches, a static ISP IP for logins and sessions. Test both with the $4.99 trial.

## Python web scraping libraries at a glance (checked 5 Dec 2026)

| Library | Job | Latest version (PyPI) | Released | Needs Python | Runs JavaScript | How you set a proxy |
| --- | --- | --- | --- | --- | --- | --- |
| **Requests** | Download pages (sync) | 2.34.2 | 14 May 2026 | 3.10+ | No | `proxies={"http": url, "https": url}` |
| **HTTPX** | Download pages (sync + async, HTTP/2) | 0.29.0 | 26 Nov 2026 | 3.10+ | No | `proxy=url` (`proxies=` removed in 0.28) |
| **aiohttp** | Download pages (async) | 3.14.5 | 11 Oct 2026 | 3.10+ | No | `proxy=url` on the session or on each request |
| **curl_cffi** | Download pages with a browser-like TLS/HTTP2 fingerprint | 0.17.0 | 26 Oct 2026 | 3.10+ | No | `proxies={"https": url}` or `proxy=url` |
| **BeautifulSoup** | Parse HTML (forgiving, easy) | 4.15.0 | 7 Jun 2026 | 3.7+ | No | n/a (parser only) |
| **lxml** | Parse HTML/XML (fast, XPath) | 6.2.1 | 29 Nov 2026 | 3.8+ | No | n/a (parser only) |
| **parsel** | Parse with CSS + XPath (Scrapy's selector library) | 1.12.1 | 28 Sep 2026 | 3.10+ | No | n/a (parser only) |
| **selectolax** | Parse HTML (fastest we timed) | 1.0.2 | 22 Oct 2026 | 3.9 to 3.15 | No | n/a (parser only) |
| **Scrapy** | Full crawling framework | 2.20.0 | 6 Nov 2026 | 3.11+ | No (add-ons exist) | `meta={"proxy": url}` on each request |
| **Playwright** | Drive a real browser | 1.65.3 | 1 Dec 2026 | 3.10+ | Yes | `proxy={"server", "username", "password"}` |
| **Selenium** | Drive a real browser (WebDriver) | 4.54.0 | 23 Nov 2026 | 3.10+ | Yes | `--proxy-server` flag (no user:pass, see below) |
| **Crawl4AI** | Browser crawler that outputs LLM-ready Markdown | 0.9.6 | 20 Nov 2026 | 3.10+ | Yes | `BrowserConfig(proxy_config={...})` |

In the code below, `url` means a proxy line in the form `http://USERNAME:PASSWORD@PROXY_HOST:PROXY_PORT`. You get yours from the CleanProxies dashboard right after you buy; the examples read it from environment variables so no password sits in your script.

### Setup used by every example

```bash
python3 -m venv scrape-env && . scrape-env/bin/activate
pip install requests httpx aiohttp curl_cffi beautifulsoup4 lxml parsel selectolax scrapy playwright selenium crawl4ai
playwright install chromium

export USERNAME="your-proxy-username" PASSWORD="your-proxy-password"
export PROXY_HOST="host-from-your-dashboard" PROXY_PORT="port-from-your-dashboard"

# a saved page for the parser examples
curl -s https://books.toscrape.com/catalogue/page-1.html -o page.html
```

## How to choose: fetch, parse, or drive a browser

Every scraper does three jobs, and each library on the list does one or two of them:

1. **Fetch:** send the HTTP request and get the HTML back. Requests, HTTPX, aiohttp and curl_cffi do only this. It is cheap: one request, one HTML document, no images or scripts.
2. **Parse:** turn the HTML into data (titles, prices, links). BeautifulSoup, lxml, parsel and selectolax do only this, and they never touch the network.
3. **Render:** when the data is only built by JavaScript after the page loads, you need a real browser. Playwright, Selenium and Crawl4AI do fetch, render and give you the final HTML (and Scrapy can hand rendering off to Playwright through an add-on).

The quick test for which one you need: open the page, view the source (not the inspector), and search for a value you want, such as a price. If it is in the source, a fetch library plus a parser is enough. If it is not, the page builds it with JavaScript: look for the JSON request it loads in the browser's Network tab first (often the cleanest data source), and use a browser library only if that fails.

| Your job | Pick | Why |
| --- | --- | --- |
| A few hundred static pages, first scraper | Requests + BeautifulSoup | Most tutorials, clearest errors |
| Thousands of static pages | HTTPX (async) or Scrapy + lxml/parsel/selectolax | Concurrency and a fast parser |
| A crawl with many page types, retries, exports | Scrapy | Scheduler, throttling, pipelines built in |
| Pages built by JavaScript, logins, clicks | Playwright | Modern browser API, per-context proxies |
| An existing Selenium test suite | Selenium | Reuse what you have |
| Pages fed straight into an LLM | Crawl4AI | Clean Markdown output |
| Sites that reject Python's default TLS handshake | curl_cffi | Browser-like TLS and HTTP/2 fingerprint |

## The fetch libraries

### Requests: the default for simple scrapers

Requests is the library most Python scraping tutorials start with. It is synchronous (one request at a time per thread), has very clear errors, and its `Session` keeps cookies and reuses connections. Version 2.34.2 needs Python 3.10 or newer.

```python
import os
import requests

proxy = f"http://{os.environ['USERNAME']}:{os.environ['PASSWORD']}@{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}"

with requests.Session() as s:
    s.proxies = {"http": proxy, "https": proxy}
    s.headers["User-Agent"] = "Mozilla/5.0 (your-bot-name; contact@example.com)"
    r = s.get("https://books.toscrape.com/", timeout=20)
    r.raise_for_status()
    print(r.status_code, len(r.text))
```

Set both `http` and `https` keys: if you set only `http`, every HTTPS request goes out from your own IP. The full walkthrough with retries is on our [Python Requests proxy](https://www.cleanproxies.com/integrations/python-requests) page.

### HTTPX: Requests-style code with async and HTTP/2

HTTPX looks like Requests but also has an `AsyncClient`, so one process can keep dozens of requests in flight. It also supports HTTP/2 (install `httpx[http2]`).

**The trap:** HTTPX removed the old `proxies=` argument in version 0.28 (November 2024), and 0.29 does not bring it back. On 5 December 2026, with HTTPX 0.29.0, `httpx.Client(proxies=...)` raised `TypeError: Client.__init__() got an unexpected keyword argument 'proxies'` in our test environment. Use `proxy=` for one proxy, or `mounts=` to send different hosts through different proxies. Many older tutorials still show `proxies=`, and copying them now fails.

```python
import asyncio
import os
import httpx

proxy = f"http://{os.environ['USERNAME']}:{os.environ['PASSWORD']}@{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}"
urls = [f"https://books.toscrape.com/catalogue/page-{i}.html" for i in range(1, 6)]

async def main():
    limits = httpx.Limits(max_connections=5)
    async with httpx.AsyncClient(proxy=proxy, limits=limits, timeout=20) as client:
        responses = await asyncio.gather(*(client.get(u) for u in urls))
        for r in responses:
            print(r.status_code, r.url)

asyncio.run(main())
```

Keep the connection limit modest. Async makes it easy to send far more requests than a site wants, and a polite, steady rate keeps your IPs usable for longer.

### aiohttp: async-only and very mature

aiohttp is an async HTTP client and server. It is a good fit when your scraper already runs inside an asyncio application. You can pass the proxy on each request (below) or once as a default on the `ClientSession`:

```python
import asyncio
import os
import aiohttp

proxy = f"http://{os.environ['USERNAME']}:{os.environ['PASSWORD']}@{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}"

async def main():
    async with aiohttp.ClientSession() as session:
        async with session.get("https://books.toscrape.com/", proxy=proxy, timeout=aiohttp.ClientTimeout(total=20)) as r:
            print(r.status, len(await r.text()))

asyncio.run(main())
```

### curl_cffi: when the handshake gives you away

Python's standard HTTP stack opens TLS connections in a way that does not look like Chrome or Safari, and some sites treat that handshake differently from a browser's. curl_cffi is built on curl-impersonate: with `impersonate="chrome"` it sends a browser-like TLS and HTTP/2 fingerprint, and the API mirrors Requests.

```python
import os
from curl_cffi import requests

proxy = f"http://{os.environ['USERNAME']}:{os.environ['PASSWORD']}@{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}"

r = requests.get("https://books.toscrape.com/", impersonate="chrome", proxies={"http": proxy, "https": proxy}, timeout=20)
print(r.status_code, len(r.text))
```

A matching fingerprint does not make a scraper welcome: if a site's terms or robots.txt say no, a different handshake does not change that. It helps when a site you are allowed to read simply mis-classifies your client.

## The parsers, with our timing test

Parsers do not use the network, so their speed is easy to measure fairly. On 5 December 2026 we downloaded page 1 of books.toscrape.com (a public sandbox built for scraping practice: 50,509 bytes of HTML, 20 books) and extracted the 20 titles and prices with each parser. Each parser ran 100 times, five rounds, and we took the median. Every parser returned exactly the same 20 rows (the script checks this). Python 3.12.15 on one of our Linux servers, with the library versions in the table above. "Pages per second" below is calculated from the median, for parsing only. The full output:

```text
page bytes 50509 books/page 20
requests 10 pages sequential: 0.25s ; httpx async 10 pages (5 at a time): 0.29s
BeautifulSoup + html.parser: 23.92 ms per page (median of 5x100)
BeautifulSoup + lxml: 17.84 ms per page (median of 5x100)
lxml XPath: 1.52 ms per page (median of 5x100)
parsel (CSS): 1.79 ms per page (median of 5x100)
selectolax: 0.59 ms per page (median of 5x100)
```

| Parser | ms per page (our run) | Pages per second, one core | Selector style |
| --- | --- | --- | --- |
| selectolax (lexbor) | 0.59 | about 1,690 | CSS |
| lxml | 1.52 | about 660 | XPath (CSS with `cssselect`) |
| parsel | 1.79 | about 560 | CSS + XPath |
| BeautifulSoup + lxml | 17.84 | about 56 | CSS (`select`) + its own find API |
| BeautifulSoup + html.parser | 23.92 | about 42 | CSS (`select`) + its own find API |

The second line is the script's fetch check: 10 pages with Requests one by one, then the next 10 with HTTPX five at a time. The sandbox site answered so fast that both took about a quarter of a second, so this tells you nothing about which client is faster; async pays off when each response takes longer, as it does through any proxy or on a slow site.

What the parser numbers mean in practice: they hold for this page shape on our machine, and your pages and hardware will give different absolute numbers. For a few thousand pages a day, any parser is fast enough. At hundreds of thousands of pages a day, 24 ms versus 1-2 ms per page is the difference between hours and minutes of CPU, and swapping BeautifulSoup for lxml, parsel or selectolax is usually a small change. The script we ran (`bench.py`):

```python
import time, asyncio, statistics, requests, httpx
from bs4 import BeautifulSoup
from lxml import html as lh
from parsel import Selector
from selectolax.lexbor import LexborHTMLParser as HTMLParser

BASE = "https://books.toscrape.com/catalogue/page-{}.html"
UA = {"User-Agent": "Mozilla/5.0 (parser benchmark)"}

s = requests.Session(); t = time.perf_counter(); pages = []
for i in range(1, 11):
    r = s.get(BASE.format(i), headers=UA, timeout=20); r.raise_for_status(); pages.append(r.text)
t_req = time.perf_counter() - t

async def run():
    sem = asyncio.Semaphore(5)
    async with httpx.AsyncClient(headers=UA, timeout=20) as c:
        async def one(i):
            async with sem:
                r = await c.get(BASE.format(i)); r.raise_for_status(); return r.text
        return await asyncio.gather(*[one(i) for i in range(11, 21)])
t = time.perf_counter(); asyncio.run(run()); t_httpx = time.perf_counter() - t

doc = pages[0]
def bs_html():
    soup = BeautifulSoup(doc, "html.parser")
    return [(a.h3.a["title"], a.select_one(".price_color").text) for a in soup.select("article.product_pod")]
def bs_lxml():
    soup = BeautifulSoup(doc, "lxml")
    return [(a.h3.a["title"], a.select_one(".price_color").text) for a in soup.select("article.product_pod")]
def lx():
    t = lh.fromstring(doc)
    return list(zip(t.xpath('//article[@class="product_pod"]/h3/a/@title'),
                    t.xpath('//article[@class="product_pod"]//p[@class="price_color"]/text()')))
def ps():
    sel = Selector(text=doc)
    return [(a.css("h3 a::attr(title)").get(), a.css(".price_color::text").get()) for a in sel.css("article.product_pod")]
def sx():
    t = HTMLParser(doc)
    return [(a.css_first("h3 a").attributes["title"], a.css_first(".price_color").text()) for a in t.css("article.product_pod")]

print("page bytes", len(doc.encode()), "books/page", len(bs_html()))
print(f"requests 10 pages sequential: {t_req:.2f}s ; httpx async 10 pages (5 at a time): {t_httpx:.2f}s")
for name, f in [("BeautifulSoup + html.parser", bs_html), ("BeautifulSoup + lxml", bs_lxml),
                ("lxml XPath", lx), ("parsel (CSS)", ps), ("selectolax", sx)]:
    assert f() == bs_html(), name
    runs = []
    for _ in range(5):
        t = time.perf_counter()
        for _ in range(100): f()
        runs.append((time.perf_counter() - t) / 100 * 1000)
    print(f"{name}: {statistics.median(runs):.2f} ms per page (median of 5x100)")
```

### BeautifulSoup: easiest to learn

BeautifulSoup sits on top of a parser (Python's `html.parser`, lxml or html5lib) and gives you a forgiving, readable API. Passing `"lxml"` as the parser made it about 25% faster in our run.

```python
from bs4 import BeautifulSoup

html = open("page.html", encoding="utf-8").read()
soup = BeautifulSoup(html, "lxml")
for card in soup.select("article.product_pod"):
    print(card.h3.a["title"], card.select_one(".price_color").text)
```

### lxml: fast, with XPath

lxml wraps the C libraries libxml2 and libxslt. XPath lets you select by structure and text in one expression, which is handy on messy pages.

```python
from lxml import html as lh

tree = lh.fromstring(open("page.html", encoding="utf-8").read())
titles = tree.xpath('//article[@class="product_pod"]/h3/a/@title')
prices = tree.xpath('//article[@class="product_pod"]//p[@class="price_color"]/text()')
print(list(zip(titles, prices)))
```

### parsel: Scrapy's selectors without Scrapy

parsel is the selector library inside Scrapy, published on its own. You can mix CSS and XPath, and `::text` / `::attr()` pull values directly, so code you write with parsel moves into a Scrapy spider almost unchanged.

```python
from parsel import Selector

sel = Selector(text=open("page.html", encoding="utf-8").read())
for card in sel.css("article.product_pod"):
    print(card.css("h3 a::attr(title)").get(), card.css(".price_color::text").get())
```

### selectolax: fastest, but mind the 1.0 change

selectolax was the fastest parser in our test. **The 2026 trap:** selectolax 1.0 dropped its old Modest engine. In our run, `from selectolax.parser import HTMLParser` raised an ImportError that says "Modest backend is deprecated since selectolax 1.0" and asks you to use the lexbor backend. The fix is one import; the method names are nearly the same:

```python
from selectolax.lexbor import LexborHTMLParser

tree = LexborHTMLParser(open("page.html", encoding="utf-8").read())
for card in tree.css("article.product_pod"):
    print(card.css_first("h3 a").attributes["title"], card.css_first(".price_color").text())
```

Note the Python range on PyPI: selectolax 1.0.2 declares Python 3.9 up to (not including) 3.16.

## Scrapy: the framework for big crawls

Scrapy is not a single tool; it is a whole crawler. You write a spider class with start URLs and a `parse` method, and Scrapy handles the request queue, concurrency, retries, duplicate filtering, throttling (`AUTOTHROTTLE_ENABLED`), robots.txt (`ROBOTSTXT_OBEY`) and exports to JSON or CSV. Version 2.20.0 needs Python 3.11 or newer.

Proxies are built in: the `HttpProxyMiddleware` is on by default, so you set the proxy on each request through `meta`:

```python
import os
import scrapy

PROXY = f"http://{os.environ['USERNAME']}:{os.environ['PASSWORD']}@{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}"

class BooksSpider(scrapy.Spider):
    name = "books"
    custom_settings = {"AUTOTHROTTLE_ENABLED": True, "ROBOTSTXT_OBEY": True}

    async def start(self):
        yield scrapy.Request("https://books.toscrape.com/", meta={"proxy": PROXY})

    def parse(self, response):
        for card in response.css("article.product_pod"):
            yield {"title": card.css("h3 a::attr(title)").get(), "price": card.css(".price_color::text").get()}
        next_page = response.css("li.next a::attr(href)").get()
        if next_page:
            yield response.follow(next_page, meta={"proxy": PROXY})
```

Run it with `scrapy runspider books_spider.py -O books.json`. Note `async def start()`: Scrapy 2.20.0 has no `start_requests()` method on its base spider any more (we checked the installed package), so older tutorials that override `start_requests()` need this one-line change. We ran this spider on 5 December 2026 with the proxy lines removed (no proxy) and a 3-page limit (`CLOSESPIDER_PAGECOUNT`); it wrote 40 books to the JSON file, the first being `{"title": "A Light in the Attic", "price": "£51.77"}`. With a rotating residential gateway, each new connection can leave from a different IP, so one proxy line is enough; with a list of static ISP IPs you rotate them yourself in a downloader middleware. Our [Scrapy proxy](https://www.cleanproxies.com/integrations/scrapy) page and our guide on [how to rotate proxies in Python](https://www.cleanproxies.com/blogs/how-to-rotate-proxies-in-python) show both.

## A complete scraper: fetch, extract, save to CSV

Most real jobs are this shape: a list of pages, a polite pace, a retry when the site says slow down, and a file at the end. Requests + selectolax, through a proxy:

```python
import csv
import os
import time
import requests
from selectolax.lexbor import LexborHTMLParser

proxy = f"http://{os.environ['USERNAME']}:{os.environ['PASSWORD']}@{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}"
session = requests.Session()
session.proxies = {"http": proxy, "https": proxy}
session.headers["User-Agent"] = "Mozilla/5.0 (your-bot-name; contact@example.com)"

def fetch(url, tries=3):
    for attempt in range(tries):
        r = session.get(url, timeout=20)
        if r.status_code == 429:  # the site asks us to slow down
            wait = int(r.headers.get("Retry-After", 10 * (attempt + 1)))
            time.sleep(wait)
            continue
        r.raise_for_status()
        return r.text
    raise RuntimeError(f"gave up on {url}")

rows = []
for i in range(1, 4):
    html = fetch(f"https://books.toscrape.com/catalogue/page-{i}.html")
    for card in LexborHTMLParser(html).css("article.product_pod"):
        rows.append({"title": card.css_first("h3 a").attributes["title"],
                     "price": card.css_first(".price_color").text()})
    time.sleep(1)  # one page a second

with open("books.csv", "w", newline="", encoding="utf-8") as f:
    writer = csv.DictWriter(f, fieldnames=["title", "price"])
    writer.writeheader()
    writer.writerows(rows)
print(len(rows), "rows saved")
```

We ran this script on 5 December 2026 with the `session.proxies` line removed (no proxy): it printed `60 rows saved`. The four parser snippets above also ran that day against the saved `page.html` and printed the same 20 titles and prices.

## Browser libraries: Playwright, Selenium and Crawl4AI

### Playwright: the first choice for JavaScript pages

Playwright drives Chromium, Firefox and WebKit from one API, waits for elements on its own, and can give each browser context its own proxy, cookies and storage. Proxy username and password are supported natively:

```python
import os
from playwright.sync_api import sync_playwright

proxy = {
    "server": f"http://{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}",
    "username": os.environ["USERNAME"],
    "password": os.environ["PASSWORD"],
}

with sync_playwright() as p:
    browser = p.chromium.launch(proxy=proxy)
    page = browser.new_page()
    page.goto("https://books.toscrape.com/", timeout=30000)
    page.wait_for_selector("article.product_pod")  # wait until the content you need exists
    for card in page.locator("article.product_pod").all():
        print(card.locator("h3 a").get_attribute("title"), card.locator(".price_color").inner_text())
    browser.close()
```

After `pip install playwright`, run `playwright install chromium` once to download the browser. More options (one proxy per context, blocking images to save data) are on our [Playwright proxy](https://www.cleanproxies.com/integrations/playwright) page. For Requests, Playwright and Puppeteer side by side, see our guide on [using proxies with Python Requests, Playwright and Puppeteer](https://www.cleanproxies.com/blogs/how-to-use-proxies-with-python-requests-playwright-puppeteer).

### Selenium: fine for existing suites, awkward with proxy logins

Selenium 4.54.0 is the WebDriver standard and the right choice if your team already has Selenium code. The catch for scraping: Chrome's `--proxy-server` flag takes a host and port but no username and password, so a user:pass proxy line does not work there by itself. Your options:

- Use a static ISP proxy with **IP whitelist** authorization (add your server's IP in the CleanProxies dashboard, up to 20 IPv4 addresses), then pass only `--proxy-server=http://PROXY_HOST:PROXY_PORT`. Whitelisting is available on ISP and ISP subnet proxies; rotating residential and mobile use username and password.
- Use a small browser extension or a local forwarding proxy that adds the credentials for you.
- Move the scraping part to Playwright, which handles proxy credentials natively.

```python
import os
from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument("--headless=new")
# ISP proxy with your server's IP whitelisted in the dashboard: no username or password needed
options.add_argument(f"--proxy-server=http://{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}")
driver = webdriver.Chrome(options=options)
driver.get("https://books.toscrape.com/")
print(driver.title)
driver.quit()
```

Setup details are on our [Selenium proxy](https://www.cleanproxies.com/integrations/selenium) page.

### Crawl4AI: browser crawling with Markdown output

Crawl4AI runs a Playwright browser and returns clean Markdown that you can hand straight to an LLM, which makes it popular for AI data pipelines. Proxies go in `BrowserConfig` as `proxy_config` (the older `proxy` argument is deprecated in 0.9.6):

```python
import asyncio
import os
from crawl4ai import AsyncWebCrawler, BrowserConfig

browser_config = BrowserConfig(proxy_config={
    "server": f"http://{os.environ['PROXY_HOST']}:{os.environ['PROXY_PORT']}",
    "username": os.environ["USERNAME"],
    "password": os.environ["PASSWORD"],
})

async def main():
    async with AsyncWebCrawler(config=browser_config) as crawler:
        result = await crawler.arun("https://books.toscrape.com/")
        print(result.markdown[:500])

asyncio.run(main())
```

## Bandwidth: why your library choice changes your proxy bill

Rotating residential proxies are billed per GB, so how much data each page pulls matters as much as the price per GB. On 5 December 2026 we measured the transfer size of the same books.toscrape.com page with curl, once without and once with compression (Requests, HTTPX and aiohttp ask for compressed responses by default):

```text
$ curl -s -o /dev/null -w 'raw %{size_download}\n' https://books.toscrape.com/catalogue/page-1.html
raw 50469
$ curl -s --compressed -o /dev/null -w 'compressed %{size_download} header %{size_header}\n' https://books.toscrape.com/catalogue/page-1.html
compressed 5232 header 236
```

So this page cost about 5.5 KB through a proxy when fetched compressed, against about 50 KB without compression. A browser library also downloads the page's scripts, styles, fonts and images, so it moves more data per page; how much more depends entirely on the site.

| Approach | What travels through the proxy | Cost impact |
| --- | --- | --- |
| HTTP client + parser | One compressed HTML document per page | Lowest: our test page was about 5.5 KB |
| HTTP client calling the site's JSON endpoint | Only the data | Often the lowest of all |
| Browser, images and fonts blocked | HTML + scripts + styles | More than the HTML alone |
| Browser, everything loaded | The whole page | Highest |

Measure your own target: run 20 typical pages through your scraper, add up the response sizes, and multiply. Our sandbox page is lighter than most retail pages, so do not budget from it. Two habits cut the bill: fetch with an HTTP client whenever the data is in the HTML, and block images, media and fonts when you must use a browser.

## Which proxy fits each library

The library decides how you fetch; the proxy decides whether the site sees one busy server or many ordinary visitors. CleanProxies sells both types scrapers need:

| Scraping job | Proxy type | CleanProxies price (as low as) | Why |
| --- | --- | --- | --- |
| Many independent page fetches (Requests, HTTPX, Scrapy) | [Rotating residential proxies](https://www.cleanproxies.com/products/rotating-residential-proxies) | $0.63/GB | A fresh residential IP per request, or sticky sessions of 5 to 60 minutes or 24 hours; 50M+ IPs in 190+ countries with city and state targeting |
| Logins, carts, long browser sessions (Playwright, Selenium) | Dedicated static [ISP proxies](https://www.cleanproxies.com/products/isp-proxies) | $0.75/IP | One IP that stays yours all month, on Tier-1 US carrier ASNs, with unlimited bandwidth |
| Mobile-only pages and apps | Mobile proxies | $0.79/GB | Real 4G/5G carrier IPs, 190+ countries |

Why CleanProxies for Python scrapers: dedicated ISP IPs are 100% dedicated, never shared, with unlimited bandwidth and threads, so a busy Scrapy crawl does not run up a data bill, plus 100Gbps network ports, under 20 ms latency and 99.9% uptime; residential and mobile GB never expire, so a scraper that runs only some weeks does not lose data it paid for; delivery is instant and support is there 24/7. Every proxy line is an HTTP(S) proxy with username and password, which Requests, HTTPX, aiohttp, curl_cffi, Scrapy, Playwright and Crawl4AI accept directly; ISP proxies also offer SOCKS5 and IP whitelist, which is how Selenium uses them.

Not sure which type your target needs? Our [proxies for web scraping](https://www.cleanproxies.com/use-cases/web-scraping) page explains the trade-offs, and [static vs rotating proxies for scraping](https://www.cleanproxies.com/blogs/static-vs-rotating-proxies-for-scraping) has a decision table. Our round-up of the [best residential proxies for web scraping](https://www.cleanproxies.com/blogs/best-residential-proxies-for-web-scraping) compares providers side by side.

### What it costs at three sizes (from our live pricing, 5 Dec 2026)

| Size | Rotating residential | Static ISP (per month) |
| --- | --- | --- |
| Small project | 100 GB = $99 ($0.99/GB) | 100 IPs = $149 ($1.49/IP) |
| Growing crawl | 1,000 GB = $840 ($0.84/GB) | 1,000 IPs = $990 ($0.99/IP) |
| Large operation | 10,000 GB = $6,300 ($0.63/GB) | 10,000 IPs = $7,500 ($0.75/IP) |

Full ladders are on [our pricing page](https://www.cleanproxies.com/pricing). The price per unit drops automatically as the order grows; no sales call is needed. ISP prices shown are for our standard carriers; AT&T IPs have their own, higher ladder.

## What to test before you commit

1. Run your scraper against your real target through the proxy for an hour, at the rate you plan to use in production.
2. Count status codes: 200s versus 403s, 429s and CAPTCHA pages. A rising 429 count means slow down, not add IPs.
3. Check the exit IP and its network with our [proxy checker](https://www.cleanproxies.com/tools/proxy-checker).
4. Measure GB per 1,000 pages (residential) or requests per IP per hour (ISP), and size your order from that.

The **$4.99 trial** gives you 5 dedicated ISP IPs for 1 hour, or 100 MB of residential or mobile data, on the same network paying customers use: [start the trial](https://www.cleanproxies.com/create-account?next=/dashboard/buy-proxies/trial).

## Bulk orders and resellers

Scraping teams running 100+ static IPs get lower per-IP prices automatically, as low as $0.75/IP at 10,000 IPs ($1.49/IP at 100, $0.99/IP at 1,000), and whole /24 ISP subnets go as low as $1.19/IP on a 1,020-IP order. If you build scraping tools or resell proxies, the CleanProxies reseller API gives tier pricing once you deposit $500 or are approved.

## How to buy on CleanProxies

Pick the product, choose the amount (and country for residential, carrier for ISP), and pay by card, Apple Pay or Google Pay, or crypto (BTC, ETH, USDT, USDC). Proxies are usually delivered to your dashboard within seconds, where you copy the proxy line into the code above.

## Scrape responsibly

Read the site's terms and robots.txt, scrape public data only, keep request rates modest, back off on 429 responses, and do not collect personal data you have no lawful reason to hold. Proxies spread your requests across IPs; they do not change what a site allows. Our guide on [how to scrape a website](https://www.cleanproxies.com/blogs/how-to-scrape-a-website) walks through a full project step by step.

## FAQs

### What is the best Python library for web scraping?

For most people, Requests plus BeautifulSoup is the best start. For large crawls, Scrapy is the best Python web scraping library because it includes queues, retries and throttling. For JavaScript pages, Playwright. Add CleanProxies rotating residential proxies from $0.63/GB when one IP is not enough.

### Is Scrapy better than BeautifulSoup?

They do different jobs. BeautifulSoup only parses HTML you already downloaded; Scrapy downloads, schedules, retries and exports. Use BeautifulSoup for small scripts and Scrapy once you crawl thousands of pages. In our test, Scrapy's selector library (parsel) parsed a page about 13 times faster than BeautifulSoup with Python's built-in parser.

### Which Python web scraping libraries support proxies?

All the fetch and browser libraries do: Requests (\`proxies=\`), HTTPX (\`proxy=\` since \`proxies=\` was removed), aiohttp (\`proxy=\`), curl_cffi, Scrapy (\`meta\["proxy"\]\`), Playwright and Crawl4AI (server, username, password). Selenium's Chrome flag has no login field, so use IP whitelisting on ISP proxies or Playwright.

### Do I need Selenium or Playwright for web scraping in Python?

Only if the data is built by JavaScript. If a value appears in the page source, Requests or HTTPX plus a parser is faster and uses far less bandwidth. Check the browser's Network tab for a JSON endpoint first; use Playwright when there is none.

### Why does my Python scraper get blocked even with a good library?

Often because of the IP and the request rate rather than the library. Many requests from one datacenter IP stand out. Slow down, follow robots.txt, and send requests through CleanProxies residential or ISP IPs so traffic looks like normal visitors.
