Skip to main content

Browser

Abstra provides a built-in browser environment in the cloud, powered by Selenium Grid. You can use it for RPAs, web scraping, automated testing, and any task that requires a browser.

The browser environment supports both Selenium (WebDriver protocol) and Playwright (CDP protocol), so you can choose whichever library fits your use case.

How it works

When your project is deployed, Abstra automatically provisions a Chrome browser instance for your project. It scales to zero when not in use and starts up on demand.

  • Selenium connects via the ABSTRA_SELENIUM_URL environment variable
  • Playwright connects automatically via the SELENIUM_REMOTE_URL environment variable (no code changes needed)

In local development, both libraries fall back to launching a local Chrome instance.

A few things to keep in mind:

  • The playwright package ships with the project runtime — don't add it to requirements.txt and don't run playwright install. Other browser libraries (e.g. selenium) must be added to requirements.txt as usual.
  • In deployed projects Chrome runs on a separate machine from your code: it cannot open local files (file:// URLs) — feed it URLs or content directly (e.g. page.goto, page.set_content). Files produced by the browser (PDFs, screenshots, downloads) are written locally where your code runs.
Using the browser with agents

You can give an AI agent a headless browser using BrowserTools. The agent can navigate, click, fill forms, take screenshots, and extract page data autonomously. See Agent Tools for details.