[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-post-en-proxy-rotation-crawlee-python-guide":3},{"success":4,"payload":5,"related":64,"errors":153},true,{"id":6,"slug":7,"title":8,"excerpt":9,"body_html":10,"meta_title":11,"meta_description":12,"canonical_url":13,"canonical_override":14,"og_title":11,"og_description":12,"og_image_url":15,"faq_json":16,"key_takeaways":26,"allow_index":32,"noindex_google_only":4,"allow_follow":4,"published_at":33,"updated_at":33,"content_updated_at":34,"featured_image_url":35,"featured_image_alt":8,"card_image_url":36,"reading_time_minutes":37,"author":38,"categories":42,"tags":49,"alternates":50,"locale_paths":62,"views":63},139,"proxy-rotation-crawlee-python-guide","Proxy Rotation in Crawlee for Python: A Developer's Guide to Residential IPs","Master proxy rotation in Crawlee for Python with ProxyConfiguration, SessionPool integration, and residential proxies. Includes runnable code, production patterns, and scaling guidance.","\u003Ch2>Why Proxy Rotation in Crawlee for Python Matters\u003C\u002Fh2>\n\n\u003Cp>If you've ever watched a Crawlee crawler grind to a halt after 200 requests because every fetch hit a 403 from Cloudflare, you already know why proxy rotation in Crawlee for Python isn't optional—it's infrastructure. The framework gives you a \u003Cstrong>SessionPool\u003C\u002Fstrong> that ties cookies, browser fingerprints, and proxy IPs together, and a \u003Cstrong>ProxyConfiguration\u003C\u002Fstrong> class that can pin a residential IP per session or rotate them round-robin. This guide walks through the idiomatic way to wire residential proxies into Crawlee, with runnable code and production pitfalls.\u003C\u002Fp>\n\n\u003Cp>Before diving in: scraping public data is generally legal in many jurisdictions, but the \u003Ca href=\"https:\u002F\u002Fwww.rfc-editor.org\u002Frfc\u002Frfc9309\" rel=\"noopener noreferrer\">Computer Fraud and Abuse Act (CFAA)\u003C\u002Fa> in the US and \u003Ca href=\"https:\u002F\u002Fgdpr.eu\u002F\" rel=\"noopener noreferrer\">GDPR\u003C\u002Fa> in the EU set real boundaries. Honor \u003Ccode>robots.txt\u003C\u002Fcode>, respect rate limits, and prefer official APIs when available. This guide covers technical implementation only—you're responsible for compliance with the sites you access.\u003C\u002Fp>\n\n\u003Ch2>Crawlee Python Proxy Architecture: Sessions, Queues, and the Proxy Layer\u003C\u002Fh2>\n\n\u003Cp>Crawlee for Python (\u003Ca href=\"https:\u002F\u002Fcrawlee.dev\u002Fpython\u002Fdocs\u002F\" rel=\"noopener noreferrer\">official docs\u003C\u002Fa>) is built around a few core primitives that work together in any crawlee python proxy workflow:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>\u003Cstrong>Request Queue\u003C\u002Fstrong> — a unified, persistent queue that holds URLs, retry counts, and per-request metadata. Both \u003Ccode>BeautifulSoupCrawler\u003C\u002Fcode> and \u003Ccode>PlaywrightCrawler\u003C\u002Fcode> draw from the same queue.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Autoscaled Pool\u003C\u002Fstrong> — scales concurrency based on system resources and response times. You set \u003Ccode>max_concurrency\u003C\u002Fcode> and Crawlee handles the rest.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>ProxyConfiguration\u003C\u002Fstrong> — the bridge between the SessionPool and your proxy provider. It generates proxy URLs, optionally keyed to a \u003Ccode>session_id\u003C\u002Fcode>, so each session gets a consistent IP.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Ch3>The Crawlee Session Pool and Proxy Binding\u003C\u002Fh3>\n\n\u003Cp>The crawlee session pool manages a pool of \u003Ccode>Session\u003C\u002Fcode> objects, each with its own cookies, fingerprint, and bound proxy IP. When a session gets blocked, you retire it and the pool hands the crawler a fresh one with a different IP. The key insight: the session pool and the proxy configuration are designed to work together. When you pin a proxy to a session via \u003Ccode>new_url(session_id=...)\u003C\u002Fcode>, the session carries that IP across all its requests. Retire the session, and the next one gets a different IP automatically.\u003C\u002Fp>\n\n\u003Ch2>Crawlee ProxyConfiguration: Idiomatic Proxy Rotation\u003C\u002Fh2>\n\n\u003Cp>Crawlee's \u003Ccode>ProxyConfiguration\u003C\u002Fcode> supports two modes:\u003C\u002Fp>\n\n\u003Cp>Round-robin rotation — pass a list of proxy URLs and Crawlee cycles through them per request. Simple, but each request gets a different IP, which breaks cookie-based sessions.\u003C\u002Fp>\n\n\u003Cp>Session-pinned rotation — pass a function to \u003Ccode>new_url\u003C\u002Fcode> that takes a \u003Ccode>session_id\u003C\u002Fcode> and returns a proxy URL. Each session keeps the same IP for its lifetime, which is what most production crawlers need.\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>from crawlee.proxy_configuration import ProxyConfiguration\n\n# Round-robin: new IP every request\nround_robin_config = ProxyConfiguration(\n    proxy_urls=[\n        &apos;http:\u002F\u002Fuser-country-US:pass@gate.proxyhat.com:8080&apos;,\n        &apos;http:\u002F\u002Fuser-country-DE:pass@gate.proxyhat.com:8080&apos;,\n        &apos;http:\u002F\u002Fuser-country-GB:pass@gate.proxyhat.com:8080&apos;,\n    ]\n)\n\n# Session-pinned: same IP per session, rotated on retire\npinned_config = ProxyConfiguration(\n    new_url=lambda session_id: (\n        f&apos;http:\u002F\u002Fuser-country-US-sid-{session_id}:pass@gate.proxyhat.com:8080&apos;\n    )\n)\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>With ProxyHat, the \u003Ccode>session_id\u003C\u002Fcode> goes directly into the username string. The gateway at \u003Ccode>gate.proxyhat.com:8080\u003C\u002Fcode> interprets the \u003Ccode>sid-abc123\u003C\u002Fcode> flag and routes all requests from that session through the same residential IP. When you retire the session in Crawlee, the pool creates a new one with a different ID, and the proxy URL function generates a fresh IP automatically.\u003C\u002Fp>\n\n\u003Cp>You can also combine geo-targeting with session pinning:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode># Pin a US residential IP per session, with city-level targeting\npinned_geo_config = ProxyConfiguration(\n    new_url=lambda session_id: (\n        f&apos;http:\u002F\u002Fuser-country-US-region-new_york-city-new_york_city-sid-{session_id}:pass@gate.proxyhat.com:8080&apos;\n    )\n)\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>Residential vs Datacenter: Why IP Type Matters for Crawlee\u003C\u002Fh2>\n\n\u003Cp>Not all proxies are equal when it comes to anti-bot detection. Here's how the three main types compare for Crawlee workloads:\u003C\u002Fp>\n\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Feature\u003C\u002Fth>\n\u003Cth>Residential\u003C\u002Fth>\n\u003Cth>Datacenter\u003C\u002Fth>\n\u003Cth>Mobile\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>IP origin\u003C\u002Ftd>\n\u003Ctd>ISP-assigned home connections\u003C\u002Ftd>\n\u003Ctd>Data center hosting providers\u003C\u002Ftd>\n\u003Ctd>Cellular carriers\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Detection risk\u003C\u002Ftd>\n\u003Ctd>Low — looks like a real user\u003C\u002Ftd>\n\u003Ctd>High — flagged by most anti-bot tools\u003C\u002Ftd>\n\u003Ctd>Very low — highest trust score\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Avg latency\u003C\u002Ftd>\n\u003Ctd>200–800ms\u003C\u002Ftd>\n\u003Ctd>50–150ms\u003C\u002Ftd>\n\u003Ctd>300–1200ms\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Cost per GB\u003C\u002Ftd>\n\u003Ctd>Mid-tier\u003C\u002Ftd>\n\u003Ctd>Lowest\u003C\u002Ftd>\n\u003Ctd>Highest\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>Best for\u003C\u002Ftd>\n\u003Ctd>Cloudflare\u002FDataDome targets, SERP scraping\u003C\u002Ftd>\n\u003Ctd>Unprotected sites, high-volume simple fetches\u003C\u002Ftd>\n\u003Ctd>Hardcore anti-bot, app-store scraping\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003Cp>Services like Cloudflare Bot Management and DataDome maintain databases of datacenter IP ranges. A request from an AWS IP block gets flagged almost immediately, while a residential IP from Comcast or Deutsche Telekom blends in with organic traffic. For targets behind these systems, residential proxies aren't a luxury—they're the difference between a 5% success rate and 95%+.\u003C\u002Fp>\n\n\u003Cp>A tiered strategy works well in practice: start with residential proxies for primary requests, fall back to a different geo or mobile proxy on blocks, and reserve datacenter IPs for unprotected endpoints where speed matters more than stealth.\u003C\u002Fp>\n\n\u003Ch2>Runnable Example: BeautifulSoupCrawler with ProxyHat\u003C\u002Fh2>\n\n\u003Cp>Here's a complete, runnable example using \u003Ccode>BeautifulSoupCrawler\u003C\u002Fcode> with session-pinned residential proxies from ProxyHat:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>import asyncio\nfrom crawlee.beautifulsoup_crawler import BeautifulSoupCrawler\nfrom crawlee.proxy_configuration import ProxyConfiguration\n\n# Each Crawlee session gets a pinned residential IP\nproxy_config = ProxyConfiguration(\n    new_url=lambda session_id: (\n        f&apos;http:\u002F\u002Fuser-country-US-sid-{session_id}:pass@gate.proxyhat.com:8080&apos;\n    )\n)\n\nasync def main():\n    crawler = BeautifulSoupCrawler(\n        proxy_configuration=proxy_config,\n        max_request_retries=3,\n        max_session_retries=3,\n        max_concurrency=10,\n    )\n\n    @crawler.router.default_handler\n    async def handler(request, session, enqueue_links):\n        if request.http_status == 403:\n            # Retire the session — its bound IP is burned\n            session.retire()\n            return\n\n        if request.http_status == 200:\n            doc = request.loaded_document\n            products = doc.select(&apos;.product-card&apos;)\n            print(f&apos;Found {len(products)} products on {request.url}&apos;)\n\n            # Follow pagination\n            await enqueue_links(selector=&apos;.pagination a&apos;)\n\n    await crawler.run([&apos;https:\u002F\u002Fexample.com\u002Fproducts&apos;])\n\nasyncio.run(main())\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>What happens here: Crawlee creates sessions from the pool, each with a unique \u003Ccode>session_id\u003C\u002Fcode>. The \u003Ccode>new_url\u003C\u002Fcode> function embeds that ID in the ProxyHat username, so \u003Ccode>sid-abc123\u003C\u002Fcode> always routes through the same residential IP. When a 403 comes back, \u003Ccode>session.retire()\u003C\u002Fcode> discards the session and its IP—the next request gets a fresh session with a new ID and a new IP.\u003C\u002Fp>\n\n\u003Ch3>Generating Per-Session Usernames Programmatically\u003C\u002Fh3>\n\n\u003Cp>For more control, build session IDs and proxy URLs in a helper function rather than a lambda:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>from crawlee.proxy_configuration import ProxyConfiguration\n\nGATEWAY = &apos;gate.proxyhat.com&apos;\nPORT = 8080\nUSERNAME = &apos;user&apos;\nPASSWORD = &apos;pass&apos;\n\ndef make_proxy_url(session_id: str | None = None,\n                   country: str = &apos;US&apos;,\n                   city: str | None = None) -&gt; str:\n    &quot;&quot;&quot;Build a ProxyHat proxy URL with geo + session targeting.&quot;&quot;&quot;\n    parts = [f&apos;country-{country}&apos;]\n    if city:\n        parts.append(f&apos;city-{city.lower()}&apos;)\n    if session_id:\n        parts.append(f&apos;sid-{session_id}&apos;)\n    suffix = &apos;-&apos;.join(parts)\n    return f&apos;http:\u002F\u002F{USERNAME}-{suffix}:{PASSWORD}@{GATEWAY}:{PORT}&apos;\n\n# Use with Crawlee\nproxy_config = ProxyConfiguration(\n    new_url=lambda session_id: make_proxy_url(\n        session_id=session_id,\n        country=&apos;US&apos;,\n        city=&apos;newyork&apos;,\n    )\n)\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>This makes it easy to swap countries, add city-level targeting, or adjust session parameters without rewriting your crawler. Check \u003Ca href=\"\u002Flocations\">available proxy locations\u003C\u002Fa> for supported country and city codes.\u003C\u002Fp>\n\n\u003Ch2>Production Patterns: Retries, Concurrency, and Error Handling\u003C\u002Fh2>\n\n\u003Ch3>Session Retirement on Blocks\u003C\u002Fh3>\n\n\u003Cp>The single most important pattern in production: retire sessions aggressively on block signals. A 403 or 429 doesn't just mean \"try again\"—it means the IP is now flagged. Retiring the session ensures the pool never reuses that IP.\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>@crawler.router.default_handler\nasync def handler(request, session, enqueue_links):\n    # Block signals — retire immediately\n    if request.http_status in (401, 403, 429):\n        session.retire()\n        return\n\n    # CAPTCHA challenge — retire and log\n    if request.http_status == 503:\n        doc = request.loaded_document\n        if doc and doc.select_one(&apos;.cf-challenge&apos;):\n            session.retire()\n            print(f&apos;Cloudflare challenge on {request.url}&apos;)\n            return\n\n    # Success — process normally\n    if request.http_status == 200:\n        doc = request.loaded_document\n        # ... your extraction logic\n        await enqueue_links(selector=&apos;a.next-page&apos;)\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch3>Configuring Retries and Concurrency\u003C\u002Fh3>\n\n\u003Cp>Crawlee's autoscaled pool handles concurrency automatically, but you should set sane limits:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>\u003Ccode>max_request_retries=3\u003C\u002Fcode> — how many times a single URL is retried before being marked as failed.\u003C\u002Fli>\n\u003Cli>\u003Ccode>max_session_retries=3\u003C\u002Fcode> — how many errors a session tolerates before being retired automatically.\u003C\u002Fli>\n\u003Cli>\u003Ccode>max_concurrency=10\u003C\u002Fcode> — upper bound on parallel requests. Start low (5–10) with residential proxies and scale up based on success rates.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>With 100 concurrent sessions on residential proxies, you're effectively making 100 requests from 100 different home IPs. That's powerful, but it also means 100 potential IPs to burn if your target's anti-bot is aggressive. Monitor your block rate and adjust concurrency accordingly.\u003C\u002Fp>\n\n\u003Ch3>Custom Hooks and Middleware Patterns\u003C\u002Fh3>\n\n\u003Cp>Crawlee for Python doesn't have a traditional middleware stack like Scrapy, but you can achieve similar results through its extension points:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>Router handlers — decorated functions that process requests by URL pattern, acting as per-route middleware.\u003C\u002Fli>\n\u003Cli>Session lifecycle hooks — \u003Ccode>session.retire()\u003C\u002Fcode> and \u003Ccode>max_session_retries\u003C\u002Fcode> control when IPs are cycled.\u003C\u002Fli>\n\u003Cli>ProxyConfiguration functions — the \u003Ccode>new_url\u003C\u002Fcode> function is your proxy middleware, letting you inject geo-targeting, session pinning, or fallback logic.\u003C\u002Fli>\n\u003Cli>Pre-navigation hooks — in PlaywrightCrawler, \u003Ccode>pre_navigation_hook\u003C\u002Fcode> lets you modify the page context before requests fire.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cpre>\u003Ccode>from crawlee.playwright_crawler import PlaywrightCrawler\nfrom crawlee.proxy_configuration import ProxyConfiguration\n\nproxy_config = ProxyConfiguration(\n    new_url=lambda session_id: (\n        f&apos;http:\u002F\u002Fuser-country-US-sid-{session_id}:pass@gate.proxyhat.com:8080&apos;\n    )\n)\n\ncrawler = PlaywrightCrawler(\n    proxy_configuration=proxy_config,\n    max_request_retries=3,\n    max_concurrency=5,\n    headless=True,\n)\n\n@crawler.pre_navigation_hook\nasync def set_headers(request, session, page):\n    await page.set_extra_http_headers({\n        &apos;Accept-Language&apos;: &apos;en-US,en;q=0.9&apos;,\n        &apos;Sec-Ch-Ua&apos;: &apos;&quot;Chromium&quot;;v=&quot;120&quot;&apos;,\n    })\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>Keep \u003Ccode>max_concurrency\u003C\u002Fcode> lower with Playwright—5 concurrent browser instances is a reasonable starting point on a typical server. Each browser instance consumes 150–300 MB of RAM, so plan your container memory accordingly.\u003C\u002Fp>\n\n\u003Ch3>Error Handling in Request Handlers\u003C\u002Fh3>\n\n\u003Cp>Wrap extraction logic in try\u002Fexcept to prevent one bad page from killing the entire crawl:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>@crawler.router.default_handler\nasync def handler(request, session, enqueue_links):\n    try:\n        if request.http_status != 200:\n            if request.http_status in (403, 429):\n                session.retire()\n            return\n\n        doc = request.loaded_document\n        items = doc.select(&apos;.item&apos;)\n\n        if not items:\n            # Empty page might indicate a soft block\n            session.retire()\n            return\n\n        for item in items:\n            # ... extract data\n            pass\n\n        await enqueue_links(selector=&apos;.pagination a&apos;)\n\n    except Exception as e:\n        print(f&apos;Error on {request.url}: {e}&apos;)\n        # Don&apos;t retire on parsing errors — just log and move on\n\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>When Not to Use Browser Crawling\u003C\u002Fh2>\n\n\u003Cp>PlaywrightCrawler is powerful but expensive—it launches a full browser per session, consuming 150–300 MB of RAM each. Before reaching for it, ask:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>Does the page render content server-side? If the HTML in the initial response contains the data you need, use \u003Ccode>BeautifulSoupCrawler\u003C\u002Fcode>. It's 10–50x faster and uses a fraction of the memory.\u003C\u002Fli>\n\u003Cli>Is the data behind JavaScript? If the initial HTML is empty and content loads via XHR, you might be able to intercept those API calls directly with \u003Ccode>BeautifulSoupCrawler\u003C\u002Fcode> + \u003Ccode>httpx\u003C\u002Fcode> rather than rendering a full page.\u003C\u002Fli>\n\u003Cli>Does the anti-bot require a real browser fingerprint? Some targets (ticketing sites, certain e-commerce platforms) check for browser-specific signals that HTTP-only crawlers can't provide. This is the legitimate use case for \u003Ccode>PlaywrightCrawler\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>When you do need browser rendering, the same \u003Ccode>ProxyConfiguration\u003C\u002Fcode> applies—just pass it to \u003Ccode>PlaywrightCrawler\u003C\u002Fcode> instead of \u003Ccode>BeautifulSoupCrawler\u003C\u002Fcode>. The session pool and proxy binding work identically across both crawler types.\u003C\u002Fp>\n\n\u003Ch2>Scaling: Containerization and Headless Fleets\u003C\u002Fh2>\n\n\u003Cp>For large-scale crawls, containerize your Crawlee workers with Docker and distribute across multiple machines. Each container runs an independent Crawlee instance with its own SessionPool, but they can share the same RequestQueue if you configure a storage backend.\u003C\u002Fp>\n\n\u003Cp>Key scaling considerations:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>Session pool size — set \u003Ccode>max_pool_size\u003C\u002Fcode> to match your concurrency. Each session holds a proxy IP, so 100 sessions means 100 residential IPs in rotation.\u003C\u002Fli>\n\u003Cli>Rate per IP — keep requests per IP per minute low. 5–10 requests per minute per residential IP is a safe baseline for most targets.\u003C\u002Fli>\n\u003Cli>Memory — BeautifulSoupCrawler uses ~50 MB per worker; PlaywrightCrawler uses 150–300 MB per browser instance.\u003C\u002Fli>\n\u003Cli>Network — with 50 concurrent residential proxy connections at 200ms average latency, you need enough bandwidth to handle ~250 requests\u002Fsecond.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>See \u003Ca href=\"\u002Fuse-cases\u002Fweb-scraping\">web scraping use cases\u003C\u002Fa> and \u003Ca href=\"\u002Fuse-cases\u002Fserp-tracking\">SERP tracking\u003C\u002Fa> for architecture patterns specific to those workloads.\u003C\u002Fp>\n\n\u003Ch2>Ethics, Legal Boundaries, and Best Practices\u003C\u002Fh2>\n\n\u003Cp>A few principles to keep your crawlers on the right side of the line:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>Honor \u003Ccode>robots.txt\u003C\u002Fcode> — the \u003Ca href=\"https:\u002F\u002Fwww.rfc-editor.org\u002Frfc\u002Frfc9309\" rel=\"noopener noreferrer\">RFC 9309\u003C\u002Fa> standard defines how crawlers should interpret it. Crawlee doesn't enforce it by default; you can add a middleware or check it manually.\u003C\u002Fli>\n\u003Cli>Respect rate limits — if a site returns 429, back off. Proxy rotation helps you avoid triggering rate limits, but it doesn't give you license to ignore them.\u003C\u002Fli>\n\u003Cli>Prefer official APIs — if a site offers an API, use it. Scraping should be a last resort, not a first instinct.\u003C\u002Fli>\n\u003Cli>Public data only — don't scrape behind authentication unless you have explicit permission. The CFAA has been used to prosecute unauthorized access, even when credentials were obtained legally.\u003C\u002Fli>\n\u003Cli>GDPR and CCPA — if you're scraping personal data (names, emails, profile info), you may be processing protected personal data under GDPR. Consult legal counsel for EU-targeted scraping.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>Ready to wire residential proxies into your Crawlee crawler? Check out \u003Ca href=\"\u002Fpricing\">ProxyHat pricing\u003C\u002Fa> for residential and mobile plans, or read the \u003Ca href=\"https:\u002F\u002Fdocs.proxyhat.com\u002F\" rel=\"noopener noreferrer\">ProxyHat documentation\u003C\u002Fa> for full gateway configuration details.\u003C\u002Fp>","Proxy Rotation in Crawlee for Python | ProxyHat","Master proxy rotation in Crawlee for Python. Learn ProxyConfiguration, SessionPool integration, residential proxy setup, and production patterns.","\u002Fblog\u002Fproxy-rotation-crawlee-python-guide",null,"https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fproxy-rotation-crawlee-python-guide-og.webp",[17,20,23],{"question":18,"answer":19},"Why does Proxy Rotation in Crawlee for Python matter for proxy users?","Without proxy rotation, a Crawlee crawler sends all requests from a single IP. Anti-bot systems like Cloudflare and DataDome flag high-volume requests from one IP and return 403 or 429 responses. Proxy rotation distributes requests across many residential IPs, making your crawler look like multiple organic users. Session-pinned rotation—where each session keeps the same IP—preserves cookie consistency and reduces block rates compared to per-request rotation.",{"question":21,"answer":22},"Which proxy type works best for Proxy Rotation in Crawlee for Python?","Residential proxies work best for most Crawlee crawlers targeting anti-bot-protected sites. They originate from real ISP-assigned home connections, making them harder to detect than datacenter IPs. Datacenter proxies are faster and cheaper but get flagged by Cloudflare and DataDome. Mobile proxies have the highest trust scores but are the most expensive. A tiered approach—residential for hard targets, datacenter for unprotected endpoints—offers the best balance of cost and reliability.",{"question":24,"answer":25},"How do you avoid blocks when implementing Proxy Rotation in Crawlee for Python?","To avoid blocks: use session-pinned residential proxies via ProxyConfiguration's new_url(session_id=...), call session.retire() on 403\u002F429 responses to discard burned IPs, keep max_concurrency conservative (5–10 with residential proxies), set max_request_retries=3, and monitor your block rate. Don't reuse retired sessions—the SessionPool automatically creates fresh ones with new IPs. Also honor robots.txt and respect rate limits to avoid triggering anti-bot escalation.",[27,28,29,30,31],"Use session-pinned proxy rotation in Crawlee to keep cookies and fingerprints tied to a consistent residential IP.","Retire sessions immediately on block signals like 403 or 429 to prevent reusing flagged proxy IPs.","Choose residential proxies over datacenter IPs to bypass advanced anti-bot systems like Cloudflare.","Opt for BeautifulSoupCrawler over PlaywrightCrawler when possible to save memory and increase speed.","Build proxy URLs programmatically to easily inject geo-targeting and session IDs into your crawler.",false,"2026-07-13T10:04:24+00:00","2026-11-17T09:21:31+00:00","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fproxy-rotation-crawlee-python-guide-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fproxy-rotation-crawlee-python-guide-card.webp",12,{"name":39,"slug":40,"bio":41,"avatar_url":14,"website_url":14,"social_links":14},"ProxyHat Team","proxyhat-team","The ProxyHat editorial team covers proxies, web scraping, and data extraction.",[43],{"id":44,"slug":45,"name":46,"description":14,"meta_title":47,"meta_description":48,"parent_id":14},4,"developer-guides","Developer Guides","Developer Guides | ProxyHat Blog","Code tutorials and SDK guides for integrating proxies into your applications.",[],{"pt":51,"es":52,"ko":53,"tr":54,"ja":55,"pl":56,"ru":57,"en":13,"fr":58,"de":59,"it":60,"zh":61,"x-default":13},"\u002Fpt\u002Fblog\u002Frotacao-proxy-crawlee-python","\u002Fes\u002Fblog\u002Frotacion-proxies-crawlee-python","\u002Fko\u002Fblog\u002Fcrawlee-python-proxy-rotation-guide","\u002Ftr\u002Fblog\u002Fcrawlee-python-proxy-rotasyonu-rehberi","\u002Fja\u002Fblog\u002Fcrawlee-python-proxy-rotation","\u002Fpl\u002Fblog\u002Frotacja-proxy-crawlee-python","\u002Fru\u002Fblog\u002Frotaciya-proksi-crawlee-python","\u002Ffr\u002Fblog\u002Frotation-proxy-crawlee-python","\u002Fde\u002Fblog\u002Fproxy-rotation-crawlee-python","\u002Fit\u002Fblog\u002Frotazione-proxy-crawlee-python","\u002Fcn\u002Fblog\u002Fcrawlee-python-proxy-rotation",{"pt":51,"es":52,"ko":53,"tr":54,"ja":55,"pl":56,"ru":57,"en":13,"fr":58,"de":59,"it":60,"zh":61},153,[65,98,124,138],{"id":66,"slug":67,"title":68,"excerpt":69,"featured_image_url":70,"featured_image_alt":68,"card_image_url":71,"og_image_url":72,"published_at":73,"updated_at":74,"content_updated_at":75,"reading_time_minutes":76,"is_featured":32,"indexable":4,"views":77,"author":78,"categories":79,"tags":81},210,"proxy-setup-for-ai-agents","Proxy Setup for AI Agents: browser-use, Crawl4AI and an MCP Server","Agents on cloud VMs exit from datacenter IPs. Here is current, working proxy configuration for browser-use, Crawl4AI and an MCP server, with a sticky-vs-rotating decision table and the cost traps to avoid.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fproxy-setup-for-ai-agents-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fproxy-setup-for-ai-agents-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fproxy-setup-for-ai-agents-og.webp","2026-10-24T09:00:00+00:00","2026-10-24T09:00:20+00:00","2026-10-03T09:31:26+00:00",14,34,{"name":39,"slug":40,"bio":41,"avatar_url":14,"website_url":14,"social_links":14},[80],{"id":44,"slug":45,"name":46,"description":14,"meta_title":47,"meta_description":48,"parent_id":14},[82,86,90,94],{"id":83,"slug":84,"name":85},1,"web-scraping","Web Scraping",{"id":87,"slug":88,"name":89},2,"residential-proxies","Residential Proxies",{"id":91,"slug":92,"name":93},9,"python","Python",{"id":95,"slug":96,"name":97},22,"playwright","Playwright",{"id":99,"slug":100,"title":101,"excerpt":102,"featured_image_url":103,"featured_image_alt":101,"card_image_url":104,"og_image_url":105,"published_at":106,"updated_at":107,"content_updated_at":75,"reading_time_minutes":76,"is_featured":32,"indexable":4,"views":108,"author":109,"categories":110,"tags":112},206,"camoufox-residential-proxies-python-guide","Camoufox with Residential Proxies: A Code-First Python Guide","How to run Camoufox, the C++-patched Firefox, behind residential proxies: current Python API, why geoip needs a sticky session, a fingerprint coherence checklist, and when Patchright or nodriver fits better.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fcamoufox-residential-proxies-python-guide-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fcamoufox-residential-proxies-python-guide-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fcamoufox-residential-proxies-python-guide-og.webp","2026-10-13T09:00:00+00:00","2026-10-13T09:00:22+00:00",45,{"name":39,"slug":40,"bio":41,"avatar_url":14,"website_url":14,"social_links":14},[111],{"id":44,"slug":45,"name":46,"description":14,"meta_title":47,"meta_description":48,"parent_id":14},[113,114,115,119,120],{"id":83,"slug":84,"name":85},{"id":87,"slug":88,"name":89},{"id":116,"slug":117,"name":118},6,"anti-detection","Anti-Detection",{"id":91,"slug":92,"name":93},{"id":121,"slug":122,"name":123},21,"headless-browser","Headless Browser",{"id":125,"slug":126,"title":127,"excerpt":128,"featured_image_url":129,"featured_image_alt":127,"card_image_url":130,"og_image_url":131,"published_at":132,"updated_at":132,"content_updated_at":34,"reading_time_minutes":37,"is_featured":32,"indexable":4,"views":133,"author":134,"categories":135,"tags":137},176,"got-scraping-nodejs-residential-proxies","got-scraping in Node.js: A Developer's Guide with Residential Proxies","A practical guide to using Apify's got-scraping HTTP client in Node.js with residential proxies — header generation, proxy rotation, retry hooks, and Crawlee scaling patterns for production scrapers.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fgot-scraping-nodejs-residential-proxies-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fgot-scraping-nodejs-residential-proxies-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fgot-scraping-nodejs-residential-proxies-og.webp","2026-08-04T16:05:06+00:00",130,{"name":39,"slug":40,"bio":41,"avatar_url":14,"website_url":14,"social_links":14},[136],{"id":44,"slug":45,"name":46,"description":14,"meta_title":47,"meta_description":48,"parent_id":14},[],{"id":139,"slug":140,"title":141,"excerpt":142,"featured_image_url":143,"featured_image_alt":141,"card_image_url":144,"og_image_url":145,"published_at":146,"updated_at":146,"content_updated_at":147,"reading_time_minutes":37,"is_featured":32,"indexable":32,"views":148,"author":149,"categories":150,"tags":152},175,"rotating-proxies-in-colly-golang","Rotating Proxies in Colly: A Framework-Idiomatic Guide for Go Developers","A developer-first guide to implementing rotating proxies in Colly using residential IPs, custom proxy switchers, geo-targeting, and production patterns for high-throughput Go web scraping.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Frotating-proxies-in-colly-golang-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Frotating-proxies-in-colly-golang-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Frotating-proxies-in-colly-golang-og.webp","2026-08-04T10:05:34+00:00","2026-10-03T08:29:56+00:00",81,{"name":39,"slug":40,"bio":41,"avatar_url":14,"website_url":14,"social_links":14},[151],{"id":44,"slug":45,"name":46,"description":14,"meta_title":47,"meta_description":48,"parent_id":14},[],[]]