Automation

Selenium with an antidetect browser: attach to a real profile instead of a fresh Chrome

Drive a persistent antidetect browser profile with Selenium: what WebDriver exposes, the debuggerAddress option, and tested Python and Node.js examples.

By Multime team ·

A frosted glass browser window on dark graphite, linked by a thin saffron cable to a clear glass steering wheel

You can drive an antidetect browser profile with Selenium by letting the profile start on its own and then attaching ChromeDriver to it with the debuggerAddress option. Selenium then works inside the same browser you use by hand, with its own cookies, proxy and fingerprint settings, instead of a fresh, empty Chrome that ChromeDriver launches with automation switches.

In short: Start the profile first (by hand or through the local API), then attach Selenium with ChromeDriver's debuggerAddress option, using a ChromeDriver that matches the profile's Chrome version. Selenium then works in the real profile, with its cookies, proxy and fingerprint settings, instead of a fresh automated Chrome. driver.quit() leaves an attached browser open.

This guide is for people who automate their own accounts, test their own sites or collect data where they are allowed to. It covers what WebDriver exposes, how attaching works, tested Selenium 4 examples in Python and Node.js, the ChromeDriver version you need and the limits. All sources and versions were checked on 26 October 2026: Selenium 4.51.0 on PyPI and npm, both released 9 October 2026. It is not a guide to getting past any site's bot protection.

What does WebDriver expose to a website?

The clearest signal is navigator.webdriver, a property any page can read. The W3C WebDriver spec says it "Returns true if webdriver-active flag is set, false otherwise", and that flag "is set to true when the user agent is under remote control".

That wording is from the WebDriver spec (W3C Working Draft, 2 July 2026). MDN's page on navigator.webdriver lists when Chrome sets it: when "The --enable-automation or --headless flag is used, or the --remote-debugging-port flag specifying port 0 is used."

The flag is only part of it. When ChromeDriver starts Chrome itself, it also decides what the browser looks like. The ChromeDriver capabilities page says: "By default, ChromeDriver creates a new temporary profile for each session." We launched Chrome for Testing 152 through ChromeDriver 152 and Selenium 4.51 on 26 October 2026 and read the command line. Among other switches it had:

Switch ChromeDriver added What it means for the session
--enable-automation One of MDN's conditions for navigator.webdriver being true
--remote-debugging-port=0 Another of MDN's conditions
--user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.… A new temporary profile: no cookies, history or logins
--test-type=webdriver, --disable-sync, --password-store=basic A test browser, not your everyday one

In that session navigator.webdriver returned true. So a default Selenium run is a new visitor every time, in a browser that says it is automated.

Why not just patch a fresh Chrome?

You can remove some of this, but a patched fresh browser is still a fresh browser. ChromeDriver's excludeSwitches option is a "List of Chrome command line switches to exclude that ChromeDriver by default passes when starting Chrome", and the Selenium Chrome docs show it with enable-automation.

Removing a switch doesn't give the session a history, saved logins or a stable proxy, and patches can create mismatches of their own. Our guide to Playwright stealth plugins and their limits covers the same problem from the Playwright side, including what the plugin authors say about it. For your own accounts, the usual goal is different: the same browser every time, as if you had opened it yourself.

How does Selenium attach to a browser that is already running?

Set debuggerAddress in the Chrome options to the host:port of the browser's remote debugging server. ChromeDriver then connects to that browser instead of launching a new one.

ChromeDriver documents debuggerAddress as "An address of a Chrome debugger server to connect to, in the form of <hostname/ip:port>, such as '127.0.0.1:38947'". In Selenium for Python you set it with add_experimental_option("debuggerAddress", …). In selenium-webdriver for Node.js, chrome.Options has a debuggerAddress(address) method whose source comment reads "Sets the address of a Chromium remote debugging server to connect to."

Three things follow from attaching:

  • ChromeDriver adds no launch switches. It didn't start the browser, so the table above doesn't apply. The browser keeps the command line and the user data folder it was started with.
  • Quitting the session doesn't close the browser. In ChromeDriver's source, an attached browser is handled by ChromeRemoteImpl, whose quit function only returns OK. driver.quit() ends the WebDriver session and stops ChromeDriver; the browser stays open. We saw exactly that in our tests.
  • Versions still have to match. The Selenium docs say: "the version of the Chrome browser and the version of chromedriver must match the major version."

How does this work with Multime's local API?

Multime runs each profile as its own Chromium-based browser and has a local API on your computer that opens a profile and returns the address Selenium needs. You call /api/v1/browser/start, attach to data.ws.selenium, do your work, then close the profile with /api/v1/browser/stop.

The basics from the API reference:

  • The API runs at http://127.0.0.1:50325 by default, only while the Multime app is open, and only listens on your own computer.
  • An API key is required by default. Copy it from the API page in the app and send it as Authorization: Bearer <key> or ?api_key=<key>.
  • Pick the profile with user_id (the profile ID shown in Multime) or serial_number (the No. column).
  • The local API is part of the Solo plan and higher.

A successful browser/start returns:

{
  "code": 0,
  "msg": "success",
  "data": {
    "ws": { "puppeteer": "ws://127.0.0.1:53110/devtools/browser/…", "selenium": "127.0.0.1:53110" },
    "debug_port": "53110",
    "webdriver": "/path/to/chromedriver"
  }
}

ws.selenium is the value for debuggerAddress. webdriver is the path to a chromedriver next to the profile's browser engine, when Multime finds one; when it's empty, use a chromedriver of the same Chrome version as the engine. Check code before you read data.

A clear glass key fitting into a frosted glass browser window, lit by a saffron glow on dark graphite
Selenium attaches to a profile Multime has already opened

Python example: Selenium 4 with a Multime profile

This script opens profile number 12, attaches Selenium, reads the page title and navigator.webdriver, then ends the session and closes the profile through the API. It uses requests and Selenium 4.51.

import os
import requests
from selenium import webdriver
from selenium.webdriver.chrome.service import Service

API = "http://127.0.0.1:50325"
HEADERS = {"Authorization": f"Bearer {os.environ['MULTIME_API_KEY']}"}
PROFILE = {"serial_number": 12}  # the No. column in Multime

res = requests.get(
    f"{API}/api/v1/browser/start",  # 1. open the profile through the local API
    params=PROFILE, headers=HEADERS, timeout=60,
).json()
if res["code"] != 0:
    raise RuntimeError(res["msg"])
data = res["data"]

options = webdriver.ChromeOptions()  # 2. attach Selenium to the running profile
options.add_experimental_option("debuggerAddress", data["ws"]["selenium"])
driver_path = data["webdriver"] or os.environ.get("CHROMEDRIVER")  # same major version as the engine
service = Service(executable_path=driver_path)
driver = webdriver.Chrome(service=service, options=options)

try:
    driver.get("https://example.com")
    print(driver.title)
    print("navigator.webdriver:", driver.execute_script("return navigator.webdriver"))
finally:
    # 3. End the WebDriver session; ChromeDriver leaves an attached browser running
    driver.quit()
    # 4. Close the profile through Multime so its cookies and tabs are saved
    requests.get(f"{API}/api/v1/browser/stop", params=PROFILE, headers=HEADERS, timeout=60)

If neither data["webdriver"] nor CHROMEDRIVER is set, Selenium 4.6 and later look for a driver on their own with Selenium Manager. Selenium Manager doesn't know which engine the profile runs, so the driver it picks may not match. Set the path yourself.

Node.js example: selenium-webdriver with a Multime profile

The same flow in Node.js. Save it as selenium-profile.mjs; selenium-webdriver 4.51 needs Node.js 22 or later (the engines field in its package).

import { Builder } from 'selenium-webdriver'
import chrome from 'selenium-webdriver/chrome.js'

const API = 'http://127.0.0.1:50325'
const headers = { Authorization: `Bearer ${process.env.MULTIME_API_KEY}` }
const profile = 'serial_number=12' // the No. column in Multime

// 1. Open the profile through the local API
const res = await fetch(`${API}/api/v1/browser/start?${profile}`, { headers }).then((r) => r.json())
if (res.code !== 0) throw new Error(res.msg)
const { ws, webdriver } = res.data

// 2. Attach Selenium to the running profile
const options = new chrome.Options().debuggerAddress(ws.selenium)
const builder = new Builder().forBrowser('chrome').setChromeOptions(options)
const driverPath = webdriver || process.env.CHROMEDRIVER
if (driverPath) builder.setChromeService(new chrome.ServiceBuilder(driverPath))
const driver = await builder.build()

try {
  await driver.get('https://example.com')
  console.log(await driver.getTitle())
  console.log('navigator.webdriver:', await driver.executeScript('return navigator.webdriver'))
} finally {
  // 3. End the WebDriver session; ChromeDriver leaves an attached browser running
  await driver.quit()
  // 4. Close the profile through Multime so its cookies and tabs are saved
  await fetch(`${API}/api/v1/browser/stop?${profile}`, { headers })
}

We ran both scripts on 26 October 2026 against a Chrome for Testing 152 started with a remote debugging port, with a stand-in server returning the response shape above. Both attached, loaded the page and left the browser running after quit(), as ChromeDriver's source says they should.

Which ChromeDriver version do you need?

Use a ChromeDriver with the same major version as the profile's engine. Multime's current engines are Chrome 152 on Mac and Chrome 150 on Windows; you can see and download engines in Settings → Kernels.

Multime engine ChromeDriver to use Latest build for that milestone in Chrome for Testing
Chrome 152 (macOS, Apple Silicon) ChromeDriver 152, mac-arm64 152.0.7977.82
Chrome 150 (Windows, 64-bit) ChromeDriver 150, win64 150.0.7871.124

The builds come from Google's Chrome for Testing downloads (milestone list checked 26 October 2026). The same site listed Stable Chrome at 156 on that date, which is why a driver picked for your everyday Chrome is likely to be the wrong one.

How do you check what the profile reports under Selenium?

Read the values from inside the session and compare them with the same profile opened by hand. The scripts above already print navigator.webdriver.

In our own test, attaching Selenium 4.51 to a Chrome 152 we had started ourselves returned false, while the browser ChromeDriver launched returned true. That shows the difference between the two setups; it doesn't tell you what any website concludes. Check your own profile:

  1. Open the profile by hand and run our browser fingerprint test. Note the results.
  2. Open it through the API, attach Selenium and load the same test with driver.get.
  3. Compare. Values that change only under automation are the ones to look at.
  4. If you start profiles with headless: 1, check again: MDN lists --headless among the conditions for navigator.webdriver.

Don't add stealth patches on top of a profile without testing; they can add mismatches of their own.

What are the limits?

Attaching gives Selenium a real, persistent browser. It doesn't make automation invisible, and no tool can promise that. The other limits are practical:

  • The API is local. It listens only on 127.0.0.1, so scripts run on the same computer as Multime. A VA can use it on their own computer only with the "Use the local API" permission.
  • Close profiles through the API. /api/v1/browser/stop makes Multime save the profile's cookies and open tabs and release the lock, so a teammate can open it. A profile can be open by one person at a time.
  • AdsPower-style, not AdsPower-complete. The /api/v1 endpoints follow AdsPower's paths and {code, msg, data} format, but Multime doesn't implement every AdsPower endpoint. Run existing scripts on a test profile first.
  • Engine limits apply. Screen size is always the real screen; media devices, speech voices and custom font lists aren't masked. On the Windows engine (Chrome 150), canvas masking is switched off automatically.
  • Plan. The local API needs Solo or higher. On Free, the API answers every request with a message that it's part of the paid plans.

Can you run Selenium on many profiles at once?

Yes. Call browser/start for each profile, attach one WebDriver session per profile and close each with browser/stop. Your script decides how many run at the same time, and your computer's memory and CPU set the practical limit.

/api/v1/browser/local-active lists every profile open on this computer, which helps a script pick up where it stopped. If the job is a fixed sequence of clicks and typing, Multime's no-code automation editor runs flows across profiles with a thread limit of 1 to 20 in parallel and its own scheduler, with no WebDriver needed.

Using Selenium with profiles responsibly

Automate your own accounts, your own sites, and data collection that a site allows. Read the site's terms and robots.txt before you start, keep request rates low and keep a person in the loop for anything that posts or sends messages.

Many platforms limit automated activity in their terms, and a persistent profile doesn't change those rules. If you collect public data, our page on browser profiles for web scraping starts with the questions to answer first: is there an API, what do the terms say, and what does robots.txt allow.

Frequently asked questions

Can Selenium control an antidetect browser profile?

Yes, if the profile runs on a Chromium-based engine with a remote debugging port. Start the profile, then pass its host:port to ChromeDriver with the debuggerAddress option. With Multime, /api/v1/browser/start returns that address in data.ws.selenium.

What does debuggerAddress do?

It tells ChromeDriver to connect to a Chrome that is already running instead of launching a new one. ChromeDriver's docs describe it as "An address of a Chrome debugger server to connect to", in the form hostname:port.

Is navigator.webdriver true when Selenium attaches to a running browser?

In our test with Selenium 4.51 and Chrome 152 it was false when attached and true when ChromeDriver launched the browser. MDN lists the switches that make Chrome set it, and ChromeDriver adds those switches only when it starts Chrome itself. Check your own profile, since headless mode is one of MDN's conditions.

Does driver.quit() close the Multime profile?

No. For an attached browser, ChromeDriver's quit does nothing to the browser. Call driver.quit() to end the session, then /api/v1/browser/stop so Multime closes the profile and saves its cookies and tabs.

Which ChromeDriver version do I need for Multime?

The same major version as the profile's engine: ChromeDriver 152 for the Mac engine and ChromeDriver 150 for the Windows engine. Use the path in data.webdriver when Multime returns one, or download the matching build from Chrome for Testing.

Does Selenium work on the Free plan?

Selenium itself does, but the local API that opens profiles for it needs Solo, Team or Agency. On Free, the API answers every request with a message that it's part of the paid plans.

Can I use Puppeteer or Playwright instead?

Yes. The same browser/start response has a WebSocket address for Puppeteer and a debug_port for Playwright's connectOverCDP. The local API reference has examples for both.

Start with 5 free profiles

No card needed. Mac (Apple Silicon) and Windows. Upgrade when you need more profiles or your VAs.

Download freePricing