Python · setup guide

Selenium proxy setup

Selenium is where authenticated proxies get awkward. Chrome's --proxy-server flag has no place for a password, and WebDriver cannot click the sign-in box Chrome pops up. The dependable fix is a small extension that sets the proxy and answers the auth challenge itself.
You will need

Residentialresi.proxymonkey.io:8000

ISP or datacenterIP:PORT

CredentialsUSER:PASS

Copy your own from the dashboard, which also lists the host and port for every order. Where it differs from this page, the dashboard is right.

Install

Selenium 4.6 and later fetch a matching driver for you.

terminal
pip install selenium

Rotating residential

Save these two files in a folder called proxy-auth. The extension points Chrome at the residential gateway and supplies the credentials whenever it asks.

proxy-auth/manifest.json + background.js
// manifest.json
{
  "manifest_version": 3,
  "name": "proxy-auth",
  "version": "1.0",
  "permissions": ["proxy", "webRequest", "webRequestAuthProvider"],
  "host_permissions": ["<all_urls>"],
  "background": { "service_worker": "background.js" }
}

// background.js
chrome.proxy.settings.set({
  value: {
    mode: "fixed_servers",
    rules: { singleProxy: { scheme: "http", host: "resi.proxymonkey.io", port: 8000 } },
  },
  scope: "regular",
});

chrome.webRequest.onAuthRequired.addListener(
  () => ({ authCredentials: { username: "USER", password: "PASS" } }),
  { urls: ["<all_urls>"] },
  ["blocking"],
);

A static datacenter or ISP IP

Load the extension with Chrome options. For a static ISP or datacenter IP, change the host and port in background.js to the address your dashboard lists for that order.

run.py
from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument("--load-extension=/path/to/proxy-auth")

driver = webdriver.Chrome(options=options)
driver.set_page_load_timeout(30)
driver.get("https://httpbin.org/ip")
print(driver.find_element("tag name", "body").text)
driver.quit()

Keeping one identity

One driver is one browser profile with one set of cookies. To run two identities, start two drivers, each with its own copy of the extension pointing at its own static IP. On residential, a sticky session keeps one address across a login; the session setting for your account is in the dashboard.

Specific to Selenium

Things worth knowing

Branded Chrome and --load-extension

Recent Google Chrome releases ignore --load-extension. Chrome for Testing and Chromium still honour it, so point options.binary_location at one of those if the extension does not load.

Other routes

Third-party packages that wrap Selenium in a local proxy can handle auth too; check their maintenance status before you depend on one. If you are starting a new project, Playwright takes proxy credentials directly and skips all of this.

Headless still counts every byte

A headless browser downloads the same images and scripts as a visible one, and each is metered, request plus response. Selenium has no request blocking built in, so for text-only jobs a plain HTTP client is far cheaper.

When it breaks

Common errors and fixes

  • Chrome opens a "Sign in" box for the proxy and the script hangs

    Why
    The extension did not load, so nothing answered the auth challenge.
    Fix
    Check the path passed to --load-extension, and see the Chrome for Testing note above.
  • ERR_PROXY_CONNECTION_FAILED in the page

    Why
    Wrong host or port in background.js, or a firewall between you and the gateway.
    Fix
    Test the host and port with curl from the same machine.
  • TimeoutException on driver.get

    Why
    The page did not finish loading within the page-load timeout.
    Fix
    Set driver.set_page_load_timeout(30) and catch the exception; a retry on rotating residential leaves from a new address.
  • Certificate warnings in the page

    Why
    The target's certificate. The extension does not touch TLS.
    Fix
    options.accept_insecure_certs = True is for testing only.

A failed connection that moved no data is not billed. Retries you send are billed like any other request, and each shows as its own line in your usage log.

The community layer

Selenium still misbehaving?

Paste the error and the few lines that set up the proxy into Discord, with the password taken out. Someone there has seen it before.

Join the Discord

4,200+monkeys in the Discord

  • Help from humans

    Post your error, get an answer. Usually in minutes, usually from someone who has hit the same wall.

  • A status bot that tells on us

    Pool health, incidents and maintenance posted automatically. Including the bad days.

  • Deals and free traffic

    Bonus GB drops, early access to new pools, and the occasional giveaway for a good bug report.

Join the Discord4,200+ monkeys, free to lurk