Skip to main content
Slow automations increase compute costs and reduce throughput. This guide covers techniques to speed up your browser automations.
Use the trace viewer to identify which actions are taking the most time before optimizing.

Block unnecessary resources

Block heavy assets like images, stylesheets, and fonts that aren’t needed for your automation. This reduces page load time significantly.
TypeScript

Use network interception instead of DOM scraping

Intercept API responses directly instead of parsing the DOM. This is often 10x faster and more reliable. Use browser dev tools to find which API endpoints return the data you need. The following examples show the same scraper—first using DOM manipulation, then using network interception.
TypeScript
TypeScript

Set shorter timeouts

The default Playwright timeout is 30 seconds. If your pages load quickly, reduce it to fail faster on errors.
TypeScript

Optimize waiting strategies

Avoid waitForTimeout

Avoid waitForTimeout() with arbitrary delays—they waste time when pages load fast and fail when pages load slowly. Instead, wait for something specific.

Wait for DOM or network to settle

After actions that trigger page changes, use Intuned helpers:

Extract lists efficiently

When scraping lists, avoid iterating with locators—each locator call auto-waits, adding milliseconds per row that compounds over hundreds of elements. Instead:
  1. Wait for the list container to be visible
  2. Extract all data in a single evaluate() call using querySelectorAll
TypeScript

Batch evaluate calls

Each evaluate() call is a round trip to the browser. Combine multiple queries into a single call.
TypeScript

Defer heavy processing

Move expensive operations outside the browser context. Extract raw data first, then process it after the automation completes. This includes image processing, LLM calls, data transformation, and file conversions.
TypeScript

Use AuthSessions

Instead of logging in every run, use AuthSessions to reuse authenticated browser state. This can save 5-30 seconds per run depending on the login complexity.

Replace AI code with deterministic code

AI agents require multiple LLM calls per action. If your automation does predictable, repeatable steps, replace AI code with direct selectors. Use AI only for unpredictable page structures or as a fallback when deterministic code fails.
TypeScript
TypeScript

Use fetch for static content

For static content, fetch HTML directly instead of using the browser. Only use the browser when JavaScript rendering is required.
TypeScript

Adjust browser configuration

If optimizations don’t help and simple actions are still slow, the site may be JavaScript-heavy. Consider these configuration changes:
  • Use a larger machine — Upgrade your machine size in replication settings for resource-intensive sites.
  • Turn off unnecessary featuresHeadful mode, stealth mode, and proxies add overhead. Disable them in intuned.json if your automation works without them.

Additional tips

  • Build URLs directly — Instead of clicking through filters, build the final URL with query parameters (e.g., ?category=electronics&price=under-100).
  • Go to iframe URLs directly — Instead of using frameLocator, navigate directly to the iframe’s source URL to avoid loading the parent page.
  • Use fill() instead of pressSequentially()pressSequentially() types character-by-character. Use fill() for instant input unless you need keystroke events.
  • Avoid returning large data from evaluate() — Extract only the fields you need, not entire DOM elements or large HTML strings.

Optimize cost

Reduce compute and AI costs

Observability and logs

Debug with trace viewer

AuthSessions

Reuse authenticated browser state