A mobile proxy Scrapy setup is the difference between a scraper that runs for hours and one that gets blocked after 50 requests. If you've been hitting CAPTCHAs, 403 errors, or silent IP bans while scraping Google, Amazon, or any other rate-limiting site, the problem almost certainly isn't your spider logic. It's your IP. In this guide, you will learn:
- How to connect real 4G mobile proxies to Scrapy using middleware
- How to rotate IPs automatically on every request or on a schedule
- How to configure SOCKS5 and HTTP proxy protocols inside Scrapy
- How to test and verify your setup before running large-scale jobs
In this guide, you'll get working code, configuration examples, and specific advice based on how Proxy Poland's infrastructure behaves in production.

Why Mobile Proxies Beat Datacenter IPs in Scrapy Projects
Datacenter proxies are cheap, but websites have been fingerprinting them for years. A /24 subnet from AWS or OVH triggers rate-limiting algorithms the moment your requests hit a certain threshold. You'll see this most aggressively on Google Search, Instagram, Zalando, and price-comparison engines.
Mobile proxies are different. They originate from real LTE 4G and 5G SIM cards connected to physical modems. Because millions of real users share the same carrier IP ranges via CGNAT (Carrier-Grade NAT), websites can't block a mobile IP without also blocking thousands of legitimate phone users. That's why mobile IPs carry a near-zero block rate in practice.
Key takeaway: Mobile IPs sit inside CGNAT pools. Blocking one means blocking a whole neighborhood of real phone users, so sites almost never do it.
For Scrapy specifically, this matters because Scrapy pipelines can send hundreds of concurrent requests. With datacenter IPs, that volume triggers automated defenses fast. With a rotating 4G proxy, each request looks like it came from a different person scrolling through their phone on a Warsaw tram.
- Google Search: mobile IPs rarely trigger reCAPTCHA v2 challenges
- Amazon: product page scrapers stay undetected through full catalog runs
- Instagram: account management tools avoid automated action blocks
- Allegro and other Polish e-commerce: price monitors run 24/7 without interruption
How Proxy Poland's 4G Infrastructure Works With Scrapy
Proxy Poland operates a physical modem farm in Poland. Each port you rent corresponds to a dedicated LTE 4G or 5G modem with a real SIM card. Your traffic exits through that modem onto the Polish mobile carrier network, so every request carries a genuine mobile IP address.
The rotation mechanic is what makes this especially useful for Scrapy. You can trigger an IP change in two ways:
- API rotation: Send a GET request to your control panel endpoint and the modem reconnects, pulling a new IP from the carrier's CGNAT pool. This takes about 2 seconds.
- Auto-rotation: Configure the modem to rotate on a fixed interval (every N minutes) without any manual trigger.
For Scrapy integration, API rotation fits best. You call the rotation endpoint between request batches or after a configurable number of requests, then resume. The proxy host and port stay the same. Only the external IP changes.
Proxy Poland supports both HTTP and SOCKS5 protocols on every port, plus OpenVPN if you want to tunnel your entire scraper process. Bandwidth is unlimited, so you won't hit a data cap mid-crawl. Plans start at $11 for a single day, and you can grab a free 1-hour trial without a credit card to test the setup before committing.
Setting Up HTTP Mobile Proxies in Scrapy Settings
The simplest integration is a static HTTP proxy. You set it once in settings.py and every request Scrapy makes goes through your mobile proxy port. This is fine for low-volume jobs or when you're testing your spider logic.
Open your project's settings.py and add:
HTTPPROXY_ENABLED = TrueHTTP_PROXY = "http://username:password@proxy.proxypoland.com:PORT"HTTPS_PROXY = "http://username:password@proxy.proxypoland.com:PORT"
Replace username, password, and PORT with the credentials from your Proxy Poland control panel. Scrapy's built-in HttpProxyMiddleware reads these environment-style variables automatically, but you need to make sure it's enabled in your middleware stack:
DOWNLOADER_MIDDLEWARES = {
"scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware": 750,
}
Key takeaway: Static HTTP proxy setup takes under five minutes and works for any Scrapy project without custom middleware code.
One thing to watch: Scrapy's default retry middleware will retry failed requests on the same proxy. If a site returns a 429 or 403, you want to trigger an IP rotation before retrying. We'll cover that in the rotation middleware section.
Using SOCKS5 Mobile Proxies With Scrapy Middleware
SOCKS5 is a lower-level protocol. It doesn't add proxy-identifying headers to your requests, which makes your traffic slightly harder to fingerprint. For scraping targets that inspect headers closely, SOCKS5 through a mobile proxy is the cleaner option.
Scrapy doesn't support SOCKS5 natively. You need the scrapy-socks package or the more actively maintained scrapy[socks5] approach using socks and a custom downloader middleware.
Install the dependency:
pip install scrapy-socks
Then configure settings.py:
DOWNLOADER_MIDDLEWARES = {
"scrapy_socks.ProxyMiddleware": 750,
}
PROXY = "socks5://username:password@proxy.proxypoland.com:PORT"

If you want per-request proxy assignment (useful for multi-port setups), pass the proxy in the request meta instead:
yield scrapy.Request(
url,
meta={"proxy": "socks5://username:password@proxy.proxypoland.com:PORT"}
)
- SOCKS5 hides proxy-related headers that HTTP tunneling exposes
- Works for both HTTP and HTTPS targets without extra configuration
- Per-request meta assignment lets you distribute load across multiple proxy ports
- Combine with HTTP header analysis to confirm no proxy headers leak through
Building an IP Rotation Middleware for Mobile Proxies
Static proxies only get you so far. For serious scraping jobs, you want the IP to change regularly. Here's a practical middleware that calls the Proxy Poland rotation API after every N requests, then continues with the new IP.
Create a file called middlewares/proxy_rotation.py:
import requests
from scrapy import signals
class MobileProxyRotationMiddleware:
def __init__(self, rotation_url, rotate_every):
self.rotation_url = rotation_url
self.rotate_every = rotate_every
self.request_count = 0
@classmethod
def from_crawler(cls, crawler):
return cls(
rotation_url=crawler.settings.get("PROXY_ROTATION_URL"),
rotate_every=crawler.settings.getint("PROXY_ROTATE_EVERY", 50),
)
def process_request(self, request, spider):
self.request_count += 1
if self.request_count % self.rotate_every == 0:
self._rotate_ip(spider)
request.meta["proxy"] = spider.settings.get("MOBILE_PROXY")
def _rotate_ip(self, spider):
try:
resp = requests.get(self.rotation_url, timeout=10)
spider.logger.info(f"IP rotated: {resp.status_code}")
except Exception as e:
spider.logger.warning(f"Rotation failed: {e}")
Then in settings.py:
MOBILE_PROXY = "http://user:pass@proxy.proxypoland.com:PORT"PROXY_ROTATION_URL = "https://panel.proxypoland.com/api/rotate?port=PORT&key=APIKEY"PROXY_ROTATE_EVERY = 50
Key takeaway: Rotating every 50 requests is a good starting point. For aggressive targets like Google SERP scrapers, try rotating every 10 to 20 requests.
You can also hook into Scrapy's process_exception method to trigger a rotation whenever the spider catches a 403 or 429 response, making the rotation reactive rather than proactive.
Testing and Verifying Your Mobile Proxy Scrapy Setup
Before you run a full crawl, verify that the proxy is working correctly and that your external IP is actually the mobile one, not your server's datacenter IP. Skipping this step wastes hours of scraping time if something's misconfigured.
Run a quick test spider that hits an IP-check endpoint:
import scrapy
class IPCheckSpider(scrapy.Spider):
name = "ipcheck"
start_urls = ["https://api64.ipify.org?format=json"]
custom_settings = {
"HTTPPROXY_ENABLED": True,
"HTTP_PROXY": "http://user:pass@proxy.proxypoland.com:PORT",
}
def parse(self, response):
self.logger.info(f"External IP: {response.text}")
Run it with scrapy crawl ipcheck and check the logged IP. It should be a Polish mobile carrier IP, not your VPS address. You can cross-check it with Proxy Poland's IP checker to confirm the ASN and carrier details.
- Confirm the ASN belongs to a Polish mobile carrier (Orange PL, Play, T-Mobile PL, Plus)
- Check that no DNS leaks expose your real server IP using the DNS leak test
- Run a proxy speed test to benchmark latency before large jobs
- Verify response headers don't include
X-Forwarded-Forwith your datacenter IP
In our testing, Proxy Poland 4G ports show typical latency between 80ms and 300ms depending on the target server location. That's normal for mobile connections and well within acceptable range for most scraping workloads.
Common Errors and How to Fix Them
Even with a correct configuration, you'll hit snags. Here are the most frequent issues and their fixes.
ConnectionRefused or ProxyError on every request
Double-check the proxy host, port, username, and password. Copy them directly from the control panel. A single wrong character in the auth string produces this error. Also confirm the port is active in your dashboard.
Requests succeed but the IP isn't rotating
The proxy host and port stay the same after rotation. Only the external IP changes. If you're checking the proxy address itself, it won't change. Use the IP-check spider above to confirm the external IP is different after calling the rotation API.
HTTPS requests failing through SOCKS5
Make sure your scrapy-socks version supports CONNECT tunneling for HTTPS. Older versions only handle HTTP. Upgrade with pip install --upgrade scrapy-socks.
High retry rates on specific targets
Some sites fingerprint beyond the IP. They check TLS fingerprints, User-Agent consistency, and header order. Pair your mobile proxy with a realistic User-Agent header and consider setting DEFAULT_REQUEST_HEADERS in settings.py to mimic a real browser. Rotating the User-Agent on each request alongside the IP dramatically cuts block rates on aggressive targets.
Key takeaway: Mobile proxies handle the IP layer. You still need realistic headers and request pacing to avoid behavioral fingerprinting.

Conclusion
Getting a solid mobile proxy Scrapy setup running comes down to three things: picking the right protocol for your target, building rotation logic that fires before bans happen, and verifying the setup actually routes traffic through your 4G modem before you launch a big job. Datacenter IPs keep hitting walls. Mobile IPs from real LTE modems don't, because websites can't block carrier CGNAT ranges without collateral damage. Proxy Poland's infrastructure gives you dedicated 4G ports with unlimited bandwidth, 2-second IP rotation via API, and both HTTP and SOCKS5 support. Everything you need to run Scrapy jobs at scale without interruption. Try it before you commit: the free 1-hour trial requires no credit card and takes about two minutes to activate. See all plans and start your free trial on the pricing page.
