Build the task contract
Define target, permission, requested market, session mode, maximum navigation time, and what counts as a usable page.
Browser execution layer
Configure the proxy before a browser context starts, keep cookies and network identity aligned, validate the page you actually received, and close every context cleanly.
$ configure route
country=US mode=rotating timeout=15s
$ validate response
route
matched
status
200
bytes
tracked
✓ bounded retry policy active
Keep credentials in environment variables and create one isolated context per independent job.
import { chromium } from 'playwright';
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
proxy: {
server: 'http://p1.bytesflows.com:8001',
username: process.env.BF_PROXY_USER,
password: process.env.BF_PROXY_PASS,
},
locale: 'en-US',
timezoneId: 'America/New_York',
});
const page = await context.newPage();
await page.goto('https://example.com', {
waitUntil: 'domcontentloaded',
timeout: 30_000,
});
console.log({ title: await page.title(), url: page.url() });
await context.close();
await browser.close();Use a unique context and session identifier for unrelated jobs. Do not print credentials.
Treat the browser as a disposable execution environment with a declared route and acceptance criteria.
Define target, permission, requested market, session mode, maximum navigation time, and what counts as a usable page.
Set proxy, locale, timezone, storage state, and resource policy before navigation. Never reuse unrelated account state.
Check status, final URL, expected DOM markers, locale, and challenge signals before extracting or taking evidence.
Store a redacted result, classify failures, close pages and contexts, and retry only within the task budget.
Use the narrowest isolation boundary supported by the framework. Context-level configuration is useful for independent jobs; launch-level configuration may be required by some clients.
A browser loads more resources, executes scripts, stores state, follows redirects, and exposes a richer client profile. Validate the actual page and resource failures instead of assuming the proxy is the only difference.
Block nonessential media for data workflows to reduce bytes, but retain required assets for visual QA or screenshot evidence. Make the policy task-specific.
No. Challenges can depend on request behavior, browser state, account history, protocol characteristics, or explicit policy. Record the response and stop uncontrolled retries.