Skip to content
Integrations

Framework Integrations

Plug ZentisLabs proxies into your favorite tools. Copy-paste examples for Scrapy, Selenium, Puppeteer, Playwright, and more.

Scrapy

Python

Enterprise web scraping framework. Integrate via a custom downloader middleware for automatic proxy rotation on every request.

middlewares.py
# middlewares.py
import base64
class ZentisProxyMiddleware:
def __init__(self, proxy_url, proxy_user, proxy_pass):
self.proxy_url = proxy_url
self.proxy_auth = base64.b64encode(
f"{proxy_user}:{proxy_pass}".encode()
).decode()
@classmethod
def from_crawler(cls, crawler):
return cls(
proxy_url=crawler.settings.get("ZENTIS_PROXY_URL"),
proxy_user=crawler.settings.get("ZENTIS_PROXY_USER"),
proxy_pass=crawler.settings.get("ZENTIS_PROXY_PASS"),
)
def process_request(self, request, spider):
request.meta["proxy"] = self.proxy_url
request.headers["Proxy-Authorization"] = (
b"Basic " + self.proxy_auth.encode()
)
settings.py
# settings.py
ZENTIS_PROXY_URL = "http://basic.resi.zentislabs.com:12321"
ZENTIS_PROXY_USER = "USERNAME"
ZENTIS_PROXY_PASS = "YOUR_PASSWORD_country-us"
DOWNLOADER_MIDDLEWARES = {
"myproject.middlewares.ZentisProxyMiddleware": 610,
}
# Recommended Scrapy settings for proxy usage
CONCURRENT_REQUESTS = 16
CONCURRENT_REQUESTS_PER_DOMAIN = 8
DOWNLOAD_DELAY = 0.25
RETRY_TIMES = 3
RETRY_HTTP_CODES = [429, 500, 502, 503, 504]

Selenium

Python

Browser automation with proxy support. Use Selenium Wire for authenticated proxy connections with full request interception.

selenium_proxy.py
# pip install selenium selenium-wire "blinker<1.8"
from selenium.webdriver.chrome.options import Options
from seleniumwire import webdriver # selenium-wire sends the proxy credentials for you
PROXY = "USERNAME:YOUR_PASSWORD_country-us@basic.resi.zentislabs.com:12321"
# Chrome ignores user:pass in --proxy-server, so don't set it here;
# selenium-wire routes the browser through the proxy below.
chrome_options = Options()
chrome_options.add_argument("--headless=new")
proxy_options = {
"proxy": {
"http": f"http://{PROXY}",
"https": f"http://{PROXY}",
"no_proxy": "localhost,127.0.0.1",
}
}
driver = webdriver.Chrome(
options=chrome_options,
seleniumwire_options=proxy_options,
)
driver.get("https://httpbin.org/ip")
print(driver.page_source)
driver.quit()

Puppeteer

Node.js

Headless Chrome automation. Native proxy authentication support via page.authenticate() - no extensions needed.

puppeteer_proxy.js
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
args: ['--proxy-server=http://basic.resi.zentislabs.com:12321'],
headless: 'new',
});
const page = await browser.newPage();
// Authenticate with the proxy
await page.authenticate({
username: 'USERNAME',
password: 'YOUR_PASSWORD_country-us',
});
// Set realistic viewport and user-agent
await page.setViewport({ width: 1920, height: 1080 });
await page.setUserAgent(
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
);
await page.goto('https://httpbin.org/ip', {
waitUntil: 'networkidle2',
timeout: 30000,
});
const body = await page.evaluate(() => document.body.innerText);
console.log('Response:', body);
await browser.close();
})();

Playwright

Node.js

Modern browser automation by Microsoft. First-class proxy support in browser launch options with built-in auth.

playwright_proxy.js
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({
proxy: {
server: 'http://basic.resi.zentislabs.com:12321',
username: 'USERNAME',
password: 'YOUR_PASSWORD_country-us',
},
});
const context = await browser.newContext({
viewport: { width: 1920, height: 1080 },
userAgent:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
});
const page = await context.newPage();
await page.goto('https://httpbin.org/ip', {
waitUntil: 'networkidle',
});
console.log(await page.textContent('body'));
await browser.close();
})();

Python Requests

Python

The most popular HTTP library for Python. Simple proxy configuration via the proxies parameter.

requests_proxy.py
import requests
proxies = {
"http": "http://USERNAME:YOUR_PASSWORD_country-us@basic.resi.zentislabs.com:12321",
"https": "http://USERNAME:YOUR_PASSWORD_country-us@basic.resi.zentislabs.com:12321",
}
response = requests.get(
"https://httpbin.org/ip",
proxies=proxies,
timeout=30,
)
print(response.json())

Axios

Node.js

Promise-based HTTP client for Node.js. Pair it with https-proxy-agent so HTTPS requests tunnel cleanly through the proxy.

axios_proxy.js
const axios = require('axios');
const { HttpsProxyAgent } = require('https-proxy-agent');
// axios' built-in proxy option can't tunnel HTTPS (CONNECT), so use an agent
const agent = new HttpsProxyAgent(
'http://USERNAME:YOUR_PASSWORD_country-us@basic.resi.zentislabs.com:12321'
);
const instance = axios.create({
httpsAgent: agent,
proxy: false, // turn off axios' own proxy handling
timeout: 30000,
});
instance.get('https://httpbin.org/ip')
.then((response) => console.log(response.data))
.catch((error) => console.error(error.message));

Integration Tips

  • 1.Always set appropriate timeouts (15–30s) when using proxies with browser automation tools.
  • 2.Use headless mode in production to minimize resource usage.
  • 3.Rotate user-agents alongside proxy rotation for better success rates.
  • 4.For Scrapy, start with a moderate CONCURRENT_REQUESTS and raise it while your error rate stays low.
  • 5.Use sticky sessions when multi-step flows require the same IP: add _session-abc123 to the password on Light and Basic, or -session-abc123 to the username on Advanced.