Browser Automation with Antidetect
Master the three pillars of browser automation — Selenium, Puppeteer, and Playwright — and learn how to integrate them with antidetect browsers for undetectable, scalable operations.
Why Automate with Antidetect Browsers?
Standard browser automation tools leave obvious traces. Properties like navigator.webdriver, missing browser plugins, and identical fingerprints across sessions make automated browsers trivial to detect. Fingerprint systems flag these patterns instantly, leading to CAPTCHAs, bans, and blocked requests.
Antidetect browsers solve this by providing each automation session with a unique, realistic browser fingerprint — including canvas, WebGL, fonts, User-Agent, screen resolution, and dozens of other parameters. When combined with automation frameworks, you get the power of programmatic control with the stealth of a real user.
The three dominant automation frameworks each have distinct strengths. Selenium offers the widest language support and mature ecosystem. Puppeteer provides deep Chrome DevTools Protocol integration. Playwright delivers modern cross-browser automation with built-in stealth features. Below we cover each one with practical antidetect integration examples.
How Antidetect + Automation Works
Most antidetect browsers expose a local API or debugging port that automation frameworks can connect to. The typical workflow is:
Create a Browser Profile
Configure a unique fingerprint via the antidetect UI or API — set OS, browser version, screen size, WebGL vendor, fonts, timezone, language, and proxy.
Launch with Debug Port
Start the profile with remote debugging enabled. The antidetect browser opens a Chromium instance on a local port (e.g., 127.0.0.1:9222) with all fingerprint spoofing active.
Connect Your Framework
Use Selenium, Puppeteer, or Playwright to connect to the running instance via CDP (Chrome DevTools Protocol) or WebDriver. Your automation code controls a fully spoofed browser.
Automate & Scale
Run your tasks — scraping, account management, form filling — across multiple profiles in parallel. Each session has a unique fingerprint and isolated cookies/storage.
The Three Pillars of Automation
Each framework has unique advantages for antidetect integration. Choose based on your language preference, browser needs, and scale requirements.
Selenium WebDriver
Python / Java / C# / JS / RubyOverview
Selenium is the most established browser automation framework, supporting all major programming languages. It communicates with browsers through the WebDriver protocol, making it compatible with virtually any Chromium-based antidetect browser. Selenium is ideal for teams with existing test infrastructure or those who need multi-language support.
Connect to Antidetect Profile
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
# Antidetect browser exposes a debug port per profile
ANTIDETECT_DEBUG_PORT = 9222
options = Options()
options.debugger_address = f"127.0.0.1:{ANTIDETECT_DEBUG_PORT}"
# Connect to the running antidetect profile
driver = webdriver.Chrome(options=options)
# Now you control a fully spoofed browser
driver.get("https://browserleaks.com/canvas")
print(f"Title: {driver.title}")
# Verify fingerprint is spoofed
webdriver_flag = driver.execute_script(
"return navigator.webdriver"
)
print(f"navigator.webdriver: {webdriver_flag}")
# Should be: undefined or false (antidetect patches this)
# Multi-profile example: loop through profiles
import requests
API_URL = "http://localhost:3001/api/v1"
# Get list of browser profiles from antidetect API
profiles = requests.get(f"{API_URL}/browser_profiles").json()
for profile in profiles[:5]:
# Start profile with automation enabled
resp = requests.get(
f"{API_URL}/browser_profiles/{profile['id']}/start"
).json()
port = resp["automation"]["port"]
opts = Options()
opts.debugger_address = f"127.0.0.1:{port}"
d = webdriver.Chrome(options=opts)
d.get("https://example.com")
print(f"Profile {profile['name']}: {d.title}")
d.quit()
Puppeteer
Node.js / JavaScriptOverview
Puppeteer is Google's official Node.js library for controlling Chrome and Chromium. It communicates directly via the Chrome DevTools Protocol (CDP), giving you low-level access to network interception, JavaScript execution, and page manipulation. Its puppeteer.connect() method makes it perfect for attaching to antidetect browser instances that expose a WebSocket debugging endpoint.
Connect to Antidetect Profile
const puppeteer = require('puppeteer-core');
const ANTIDETECT_WS = 'ws://127.0.0.1:9222/devtools/browser';
async function automateProfile() {
// Connect to antidetect browser via WebSocket
const browser = await puppeteer.connect({
browserWSEndpoint: ANTIDETECT_WS,
defaultViewport: null // Use profile's viewport
});
const page = await browser.newPage();
await page.goto('https://browserleaks.com/webgl');
// Check that fingerprint is spoofed
const webdriver = await page.evaluate(
() => navigator.webdriver
);
console.log('navigator.webdriver:', webdriver);
// Extract page data
const title = await page.title();
console.log('Page title:', title);
// Screenshot for verification
await page.screenshot({ path: 'fingerprint-check.png' });
await page.close();
// Don't close browser - antidetect manages lifecycle
}
// Multi-profile automation via antidetect API
const axios = require('axios');
const API = 'http://localhost:3001/api/v1';
async function runMultipleProfiles() {
const { data: profiles } = await axios.get(
`${API}/browser_profiles`
);
for (const profile of profiles.slice(0, 5)) {
const { data } = await axios.get(
`${API}/browser_profiles/${profile.id}/start`
);
const browser = await puppeteer.connect({
browserWSEndpoint: data.automation.ws_endpoint,
defaultViewport: null
});
const page = await browser.newPage();
// Intercept requests for performance
await page.setRequestInterception(true);
page.on('request', req => {
if (['image', 'font'].includes(req.resourceType()))
req.abort();
else
req.continue();
});
await page.goto('https://example.com');
console.log(`${profile.name}: ${await page.title()}`);
await page.close();
}
}
automateProfile();
Playwright
Node.js / Python / Java / C#Overview
Playwright is Microsoft's modern automation framework that supports Chromium, Firefox, and WebKit from a single API. It offers auto-waiting, network mocking, and multi-context isolation out of the box. For antidetect integration, Playwright's connectOverCDP() method provides a clean way to attach to running antidetect profiles. Its built-in browser context isolation makes it especially powerful for parallel multi-account operations.
Connect to Antidetect Profile
from playwright.sync_api import sync_playwright
import requests
API_URL = "http://localhost:3001/api/v1"
def automate_with_playwright():
with sync_playwright() as p:
# Connect to antidetect profile via CDP
browser = p.chromium.connect_over_cdp(
"http://127.0.0.1:9222"
)
# Get the default context (with spoofed fingerprint)
context = browser.contexts[0]
page = context.new_page()
page.goto("https://browserleaks.com/fonts")
# Playwright auto-waits for elements
title = page.title()
print(f"Page: {title}")
# Check fingerprint spoofing
webdriver = page.evaluate("navigator.webdriver")
platform = page.evaluate("navigator.platform")
print(f"webdriver: {webdriver}, platform: {platform}")
page.screenshot(path="antidetect-check.png")
page.close()
# Parallel multi-profile automation
def run_parallel_profiles():
profiles = requests.get(
f"{API_URL}/browser_profiles"
).json()
with sync_playwright() as p:
for profile in profiles[:5]:
# Start profile via antidetect API
resp = requests.get(
f"{API_URL}/browser_profiles"
f"/{profile['id']}/start"
).json()
cdp_url = resp["automation"]["cdp_url"]
browser = p.chromium.connect_over_cdp(cdp_url)
context = browser.contexts[0]
page = context.new_page()
# Route to block heavy resources
page.route(
"**/*.{png,jpg,gif,svg,woff,woff2}",
lambda route: route.abort()
)
page.goto("https://example.com")
print(f"{profile['name']}: {page.title()}")
page.close()
browser.close()
automate_with_playwright()
Framework Comparison
| Feature | Selenium | Puppeteer | Playwright |
|---|---|---|---|
| Languages | Python, Java, C#, JS, Ruby | Node.js | Python, Node.js, Java, C# |
| Browsers | Chrome, Firefox, Edge, Safari | Chrome, Chromium | Chromium, Firefox, WebKit |
| Protocol | WebDriver / CDP | CDP (native) | CDP + custom |
| Antidetect Connection | debugger_address option | puppeteer.connect(ws) | connect_over_cdp() |
| Auto-waiting | Manual (WebDriverWait) | Manual (waitForSelector) | Built-in |
| Network Interception | Limited | Full | Full |
| Parallel Execution | Selenium Grid | Manual async | Browser contexts |
| Learning Curve | Low | Medium | Medium |
| Best For | Legacy systems, multi-lang teams | Chrome-focused scraping | Modern cross-browser automation |
Stealth Best Practices
Using an antidetect browser is the foundation, but proper automation hygiene is equally important. Follow these practices to minimize detection risk:
Randomize Timing
Add random delays between actions (200-2000ms). Uniform timing is a strong bot signal. Use Gaussian distribution for more natural patterns.
One Profile Per Account
Never reuse fingerprint profiles across different accounts. Each account should have a dedicated profile with consistent fingerprint, cookies, and proxy.
Match Proxy to Fingerprint
Ensure your proxy location matches the timezone, language, and geolocation set in the antidetect profile. Mismatches are easy to detect.
Simulate Human Behavior
Move the mouse, scroll naturally, and interact with non-target elements occasionally. Pure direct navigation to target elements is suspicious.
Warm Up Profiles
Before critical tasks, visit a few popular sites to build a natural browsing history and cookie footprint. Cold profiles with zero history raise flags.
Respect Rate Limits
Don't hammer endpoints. Implement exponential backoff and respect robots.txt. Aggressive request patterns get IPs and accounts banned fast.
Ready to Automate at Scale?
Combine the power of browser automation with undetectable fingerprint profiles. Start your free trial and scale your operations today.
Start Free Trial