Use a residential proxy in Selenium: driver setup and a first check

Chrome in Selenium has no first-class proxy auth like Playwright. This page shows a reviewable setup with fake placeholders, then checks an authorized page. Not an antidetect tutorial. Not for mainland China.

Chrome in Selenium has no first-class proxy auth like Playwright. This page shows a reviewable setup with fake placeholders, then checks an authorized page. Not an antidetect tutorial. Not for mainland China.

Copy protocol, host, port, and auth from the console, then put them in the Selenium driver. This is a library how-to: open an authorized page through a residential exit and confirm the proxy was used. Product choice for localization still belongs on localization testing. Field mapping for AdsPower-class tools is on antidetect setup. If you can use Playwright, auth is more direct: Playwright residential proxy. Plain HTTP in Python: Python residential proxy.

ZTProxy sells rotating residential (per GB) and static residential (per IP·month). Examples use fake placeholders—not production hosts. Authorized targets only. Not for mainland China.

What to have ready

Ready itemSource
Protocol, host, port, authConsole values only (not the fake placeholders)
Python, a browser driver, and Selenium 4Your local environment
Check URLA page you may access
Rotating or static orderRotating vs static

Placeholders (not production): host `proxy.example.invalid`, port `10000`, user `USER_EXAMPLE`, password `PASS_EXAMPLE_NOT_REAL`. Protocol and strings: HTTP / SOCKS5 setup, proxy format. Commands follow Docs EN quickstart.

The auth limitation, and one reviewable pattern

Chrome’s `--proxy-server` flag usually accepts a host and port only. It does not take a username and password the way Playwright’s `launch({ proxy })` does. Adding the flag alone against an authenticated residential gateway often ends in HTTP 407.

The example below uses the third-party library `selenium-wire` so credentials can live in the proxy URL. It intercepts browser traffic—review the dependency and its license yourself. It is not bundled with ZTProxy and is not part of the product. You can also switch to Playwright. Do not invent country or session fields in the username; if the console does not document them, do not append them.

import os
from seleniumwire import webdriver

user = os.environ.get("ZT_PROXY_USER", "USER_EXAMPLE")
password = os.environ.get("ZT_PROXY_PASS", "PASS_EXAMPLE_NOT_REAL")
host = os.environ.get("ZT_PROXY_HOST", "proxy.example.invalid")
port = os.environ.get("ZT_PROXY_PORT", "10000")

proxy_url = f"http://{user}:{password}@{host}:{port}"

driver = webdriver.Chrome(
    seleniumwire_options={
        "proxy": {"http": proxy_url, "https": proxy_url}
    }
)
driver.set_page_load_timeout(30)
driver.get("https://example.com")
print(driver.title)
driver.quit()

URL-encode the username or password if it contains `@` or `:`. Use SOCKS5 only when the console returns SOCKS and you configure a matching client. Do not assume UDP is available.

Sessions and common issues

Reusing a driver may reuse a gateway connection. That is not a static IP, and it is not automatically a sticky session. See sticky ≠ static.

SymptomCheck first
407Auth was never handled beyond `--proxy-server`; username/password and URL encoding; order still valid
Still your machine IPThe driver actually used the proxy; no leftover system proxy
TimeoutsProtocol and port match the console; you did not leave the fake host in place
Want to isolate the libraryRecheck the same credentials with curl

Fuller symptom table: 407 and timeouts.

Compliance and scope

Authorized targets only. This is not a guide to bypassing detection, farming accounts, or breaking login walls. Prices follow the console and pricing (rotating about $0.40/GB, about $0.20/GB on a 100 TB full bundle; static about $1.50 shared and about $5 dedicated per IP/month). USDT/USDC available; Visa/Mastercard in application. Not for mainland China.

FAQ

Why not put user:pass inside --proxy-server?

Chrome’s support for that is incomplete; auth often never reaches the gateway. Use a reviewable pattern, or switch to Playwright.

Is selenium-wire a ZTProxy product?

No. It is a third-party dependency. Review it yourself. The snippet only shows one way to pass credentials.

How is this different from the antidetect guide?

This page is Selenium code. For AdsPower-class tools, see antidetect setup.

Can I use the example host as-is?

No. Replace it with console values.

Can I use this to sign into someone else’s account?

No. Only lawful targets you are allowed to access.

If I reuse the driver, do I keep the same IP?

Not necessarily. Connection reuse is not static, and it is not automatically sticky.

What changes between rotating and static in Selenium?

The form is similar; the difference is the exit cadence and billing you purchased. Pick the product, then use that order’s credentials.

Where are prices confirmed?

In the console and on pricing.

Next steps

  1. Copy live fields from the console.
  2. Check an authorized page.
  3. When you need to choose a product, open rotating or static.