HOW TO USE PROXY POLAND WITH SELENIUM
Python and Node.js code examples for routing Selenium WebDriver through dedicated 4G/5G mobile proxies. Covers SOCKS5 and HTTP proxy configuration, credential authentication, IP rotation between sessions, and headless Chrome setup with undetected-chromedriver for bot-protected sites.
Selenium proxy configuration is most useful when it matches the browser session you are testing, not when it changes randomly between steps. Attach the Proxy Poland endpoint before the driver opens, confirm the visible IP, and then run the flow as a normal user would. This keeps location-sensitive tests for checkout, login, search, or pricing pages closer to what a real Polish visitor would see.
WHY SELENIUM + PROXY POLAND
Selenium is the most widely used browser automation framework. By routing Selenium through Proxy Poland's dedicated 4G/5G mobile proxies, you can scrape data, run tests, and automate tasks with genuine mobile IPs that reduce anti-bot detection risk.
Selenium setup should be tested with the same proxy protocol, browser profile, target website, and account workflow that will run in production. Check visible IP, DNS route, ASN, session persistence, rotation behavior, and login state before scaling.
SETUP INSTRUCTIONS
- 01
Install Dependencies
Install Selenium and the webdriver for your browser:
pip install selenium webdriver-manager # or for Node.js: npm install selenium-webdriver
- 02
Get Proxy Credentials
Sign up at proxypoland.com and get your proxy IP, port, username, and password.
- 03
Configure Chrome with Proxy (Python)
Set up Chrome WebDriver with SOCKS5 proxy:
from selenium import webdriver from selenium.webdriver.chrome.options import Options PROXY = "socks5://username:password@proxy-ip:port" options = Options() options.add_argument(f'--proxy-server={PROXY}') driver = webdriver.Chrome(options=options) driver.get('https://whatismyipaddress.com') print(driver.title) driver.quit() - 04
Configure with HTTP Proxy (Python)
Alternative HTTP proxy configuration:
from selenium import webdriver from selenium.webdriver.chrome.options import Options PROXY = "http://username:password@proxy-ip:port" options = Options() options.add_argument(f'--proxy-server={PROXY}') driver = webdriver.Chrome(options=options) driver.get('https://httpbin.org/ip') print(driver.page_source) driver.quit() - 05
Configure with Node.js
Selenium WebDriver with proxy in Node.js:
const { Builder } = require('selenium-webdriver'); const chrome = require('selenium-webdriver/chrome'); const options = new chrome.Options(); options.addArguments( '--proxy-server=socks5://username:password@proxy-ip:port' ); const driver = new Builder() .forBrowser('chrome') .setChromeOptions(options) .build(); await driver.get('https://httpbin.org/ip'); console.log(await driver.getTitle()); await driver.quit(); - 06
Add IP Rotation
Rotate IP between scraping sessions:
import requests def rotate_ip(): """Call the mobile proxy rotation API""" response = requests.get( 'https://your-proxy-ip:port/rotate', auth=('username', 'password') ) return response.json() # Rotate before each session rotate_ip() driver = webdriver.Chrome(options=options) # ... scrape with new IP - 07
Verify Your IP
Check that Selenium is using the proxy IP:
driver.get('https://httpbin.org/ip') ip_text = driver.find_element('tag name', 'pre').text print(f'Current IP: {ip_text}') # Should show a Polish mobile IP
PRO TIPS
Use SOCKS5 for full traffic routing including DNS queries
Add --headless flag for production scraping
Implement exponential backoff for rate-limited sites
Rotate IPs between page loads for large-scale scraping
Use undetected-chromedriver for sites with advanced bot detection
WORKS GREAT FOR
FAQ
Which proxy protocol is best for Selenium?+
SOCKS5 for broad compatibility and DNS leak prevention. HTTP works for basic scraping but SOCKS5 routes all traffic including DNS through the proxy.
Can I use Selenium with undetected-chromedriver and these proxies?+
Yes. undetected-chromedriver + Proxy Poland's mobile proxies is the best combination for scraping protected sites. The mobile IP handles the IP-reputation layer while undetected-chromedriver handles browser fingerprint checks.
How do I handle proxy authentication in Selenium?+
For Chrome, include credentials in the proxy URL: socks5://user:pass@host:port. For Firefox, use a proxy authentication extension or selenium-wire which handles auth transparently.
Can I run headless Selenium with these proxies?+
Yes. Add --headless=new to Chrome options. The proxy works the same way in headless mode. For sites that detect headless browsers, use undetected-chromedriver.
How fast can I scrape with mobile proxies vs datacenter?+
30-100 Mb/s throughput on Proxy Poland's 4G/5G connections. While slower than raw datacenter speed, the advantage is that you don't get blocked. One successful request through a mobile proxy is worth more than 100 blocked requests through a datacenter IP.
What WebDriver capabilities config sets the Proxy Poland proxy?+
Use the Proxy capability: from selenium.webdriver.common.proxy import Proxy, ProxyType; p = Proxy({'proxyType: ProxyType.MANUAL, 'httpProxy': 'host:port', 'sslProxy': 'host:port', 'socksProxy': 'host:port', 'socksVersion': 5}); options.proxy = p. This is the cross-browser way. ChromeOptions also accepts options.add_argument('--proxy-server=socks5://host:port'); the capability route works in both Chrome and Firefox without browser-specific code.
How do I pass the --proxy-server flag to chromedriver with auth?+
options.add_argument(f'--proxy-server=http://{host}:{port}') or socks5://. The flag does not accept user:pass — Chromium strips credentials silently. For authenticated Proxy Poland proxies, build a tiny Chrome extension that injects credentials via chrome.webRequest.onAuthRequired (manifest v2) or chrome.declarativeNetRequest (v3), then load it with options.add_extension(proxy-auth.zip'). selenium-wire is an easier wrapper that handles this automatically.
Does undetected-chromedriver accept Proxy Poland's SOCKS5 with auth?+
Yes — undetected-chromedriver inherits Chrome's --proxy-server semantics, so SOCKS5 without auth works via options.add_argument. For authenticated Proxy Poland SOCKS5, install selenium-wire alongside uc and use SeleniumWire's seleniumwire_options={'proxy: {'http: 'socks5://user:pass@host:port', 'https': 'socks5://user:pass@host:port'}'}'. uc.Chrome(seleniumwire_options=...) launches with auth-injected. uc 3.5+ explicitly supports this pattern.
How do I set browser timezone/locale to match the Polish carrier IP in Selenium?+
Chrome DevTools Protocol via execute_cdp_cmd. driver.execute_cdp_cmd('Emulation.setTimezoneOverride', {'timezoneId: 'Europe/Warsaw'}'); driver.execute_cdp_cmd('Emulation.setLocaleOverride', {'locale: 'pl-PL'}'); driver.execute_cdp_cmd('Emulation.setGeolocationOverride', {'latitude: 52.2297, 'longitude': 21.0122, 'accuracy': 100}). Run these immediately after driver init. Without them, Selenium leaks your local timezone via JS Date.getTimezoneOffset, which is the #1 anti-bot signal.
Can I run multiple Selenium grids each with a different Proxy Poland proxy?+
Yes — Selenium Grid 4. Configure each node with --selenium-manager-config or driver-specific args. Pass capabilities at session creation: driver = webdriver.Remote(command_executor='http://grid:4444', options=options) where options carries the Proxy Poland proxy for that session. The grid hub routes to whichever node has matching capabilities. For 50+ parallel sessions, run nodes in Docker with one proxy per container.
How do I rotate IPs mid-session in Selenium without losing the driver?+
You can't change the proxy of a running Chromium without restart — Chromium reads --proxy-server only at launch. Workarounds: (1) call Proxy Poland's /rotate API, which changes the underlying Polish carrier IP while keeping host:port constant — your driver keeps working with the new IP automatically. (2) Quit the driver and re-launch with a new proxy. Option 1 is the standard pattern for time-based rotation in scrapers.
Selenium 4 vs Selenium 3 for Proxy Poland — any compatibility differences?+
Selenium 4 is the recommended baseline. The Proxy capability syntax is similar, but Selenium 4 added native CDP support (driver.execute_cdp_cmd) which simplifies timezone/locale/geo overrides. Selenium 3 requires extra dependencies (chrome-devtools-protocol Python package) for CDP. Selenium 4's Remote API also supports W3C bidi which improves anti-detect on modern Chrome. Upgrade if you're still on 3.x.