Key Takeaways
Use Python with residential proxies for web scraping. Requests, Scrapy, Playwright — rotate IPs and scale.
Python + Residential Proxies for Scraping
Use Python with residential proxies in Requests, Scrapy, Playwright, or any HTTP client. Rotate IPs per request or per session to avoid blocks and scale your Python scrapers.
Quick example
import requests
proxies = {
"http": "http://user:pass@gateway:port",
"https": "http://user:pass@gateway:port"
}
r = requests.get("https://example.com", proxies=proxies)With a rotating gateway, each request can get a new residential IP.
Choosing the right Python stack
- Requests + Beautiful Soup — Good for static HTML, simple pages. Add proxies as above. See Using Requests for Web Scraping and Python Web Scraping Tutorial for Beginners.
- Scrapy — Best for large-scale crawling, built-in concurrency and retries. Configure proxies in middleware; see Scrapy Framework Guide and Using Proxies in Python Scrapers.
- Playwright (or Selenium) — For JavaScript-heavy and anti-bot–protected sites. Use Using Proxies with Playwright and Playwright Proxy Configuration Guide.
For a comparison of libraries and when to use each, read Best Python Libraries for Web Scraping and Python Scraping Framework Comparison.
Configuring residential proxies in Python
Most residential providers give you a single gateway (host:port) with username/password. The gateway assigns a new IP per request (rotating) or per session (sticky), depending on the product. In Python you typically set proxies once and every request goes through that gateway. For Scrapy, use a downloader middleware to set the proxy (and optionally rotate User-Agent). For Playwright, pass proxy in the browser launch options. Details: Python Proxy Scraping Guide and Residential Proxies to Improve Scraping.
Performance and scaling
- Use async (e.g. aiohttp, Scrapy’s async) to increase throughput without overloading targets. See Async Python Scraping with aiohttp.
- Combine proxy rotation with reasonable concurrency and retries. Python Scraping Performance Optimization and How Many Proxies You Need for Scraping give practical guidance.
- For very large jobs, consider Scaling Scrapers with Distributed Systems and Distributed Crawlers with Scrapy.
Guides
- Python Web Scraping Guide — from basics to production
- Best Python Libraries for Web Scraping — choose the right stack
- Residential Proxies to Improve Scraping — why and how to use them
- Best Proxies for Web Scraping — compare providers
Tools
- Proxy Checker — verify proxy IP and latency
- Proxy Rotator Playground — simulate IP rotation
- Scraping Test — test a URL with your proxy
Example: Scrapy with rotating residential proxy
In Scrapy, set the proxy in a downloader middleware or in the request meta. Example pattern: set proxy to http://user:pass@gateway:port and optionally rotate User-Agent per request. The gateway will assign a new residential IP per request if your provider uses rotating mode. For full examples and middleware code, see Using Proxies in Python Scrapers and Scrapy Framework Guide.
Example: Playwright with sticky session
For Playwright, pass proxy: { server: 'http://gateway:port', username: 'user', password: 'pass' } in launch(). Use sticky (session) residential proxies when you need to complete a multi-step flow (e.g. login then scrape). Same IP for the session keeps cookies and state. Using Proxies with Playwright and Playwright Proxy Configuration Guide show the exact options.
Debugging proxy issues in Python
If requests fail or return challenge pages: (1) Verify proxy with Proxy Checker. (2) Test the same URL with Scraping Test and your proxy. (3) Check headers with HTTP Header Checker. (4) For JS challenges, switch to Playwright instead of Requests. Common Proxy Mistakes in Scraping and Common Web Scraping Challenges cover more causes and fixes.
Get proxies for Python scraping
Our Residential Proxies work with any Python HTTP client or browser. You get a single gateway URL and credentials; use rotating or sticky depending on your plan. Combine with the guides above for reliable, scalable Python scraping.
Quick reference: proxy in Python
See Using Proxies in Python Scrapers, Playwright Proxy Configuration Guide, and Python Proxy Scraping Guide for full examples.
Summary
Python is the most popular language for web scraping. Pair it with residential proxies for better success on strict sites. Use Requests/Scrapy for static HTML and Playwright for JavaScript-heavy or anti-bot–protected pages. Validate with Proxy Checker and Scraping Test, then scale with the guides linked above.
More resources
- Python Web Scraping Tutorial for Beginners — first steps.
- Python Web Scraping Best Practices — production tips.
- Scraping Dynamic Websites with Python — JS and SPAs.
- Building a Python Scraping API — expose scrapers as a service.
- Extracting Structured Data with Python — parsing and storage.
Get Proxies for Python Scraping · Python Web Scraping Guide · Blog