Proxies for web scraping: collect data without getting blocked
Why websites block scrapers, which proxy type to use for data collection, and how to rotate IPs in Python.
Web scraping is automated data collection from websites: prices, products, listings, search results. The main problem is blocking. When thousands of requests come from one IP, the site shows a captcha, slows you down or blocks the address.
How proxies help
Proxies spread requests across many IPs. To the website it looks like many different visitors instead of one bot.
Which type to choose
- IPv4 / IPv6 — for sites without serious protection; the cheapest at scale, billed per IP rather than traffic. Google and YouTube support IPv6, which is the cheapest option for large-scale scraping.
- Residential — for sites with anti-bot protection: marketplaces, aggregators, sites behind Cloudflare. A new IP on every request, billed per GB.
- Mobile — when even residential IPs get captchas.
Rotation in Python
With private proxies you pick the address for each request yourself:
import random, requests
proxies = [l.strip() for l in open("proxies.txt")] # host:port:login:password
def get(url):
host, port, user, pwd = random.choice(proxies).split(":")
p = f"http://{user}:{pwd}@{host}:{port}"
return requests.get(url, proxies={"http": p, "https": p}, timeout=30)
With residential proxies it's simpler: connect to one gateway and the IP changes on every request automatically:
p = "http://your_username-country-US:password@host:8080"
requests.get("https://example.com", proxies={"http": p, "https": p})
You can download a proxies.txt with all your proxies in “My proxies” with the “Download all active” button.
Tips to avoid bans
- Throttle. Even with proxies, don't send hundreds of requests per second to one site.
- Send realistic headers:
User-Agent,Accept-Language. - Retry failed requests through another IP.
- Use sessions where login is needed — a sticky session keeps one IP (how it works).
- Respect the site's rules and data protection laws. Don't collect personal data without a legal basis.
Automate purchasing
If you need many proxies regularly, buy them through the ProxyZen API: purchase, list, renew and traffic in a few requests. Ready-made examples in Python, Node.js, PHP and curl are in the docs.
Try ProxyZen
IPv4 and IPv6 from $0.05, residential and mobile per GB. Instant delivery, HTTP(S) and SOCKS5.