# agentic browser and mobile automation with e2e core

> Use e2e core to drive browsers and mobile apps from a script. Give an agent a goal in plain English, replay actions from cache, and read structured data from the screen.

By Kacper Kapuściak. Published 2026-12-01. Canonical URL: https://e2e.com/blog/agentic-browser-and-mobile-automation-with-e2e-core

[e2e core](https://e2e.com/docs/core) lets you control browsers, mobile, desktop to automate tedious tasks with code.

It gives you all the tools you need for things like web scraping, App Store screenshot generation, or checking how many items an e-commerce store has in stock. All with a simple, common API.

It lets you open up the browser, navigate through pages, click buttons, fill out forms, extract large amounts of data and so on.

e2e core works similarly to existing automation tools like Puppeteer or Playwright but it comes with superpowers. Its agentic capabilities make it more tolerant to change whenever a website's selectors or layout change unexpectedly.

If you'd rather watch, I recorded a [video version of this walkthrough on YouTube](https://youtu.be/2YTREHZxrr4).

[Video: agentic browser and mobile automation with e2e core](https://www.youtube.com/watch?v=2YTREHZxrr4)

## get started with e2e core

To get started with e2e core install the `@e2e-dev/core` package alongside the engine for the app you want to drive. For a browser, that's `@e2e-dev/web`. Here's how I'd open the web version of my app using TypeScript on Node.js 24.8 or later:

```bash
npm install @e2e-dev/core @e2e-dev/web
```

```ts
import { launch } from "@e2e-dev/core";
import { web } from "@e2e-dev/web/engine";

await using host = await launch(web(), {
  app: { url: "https://app.example.com" },
});
await using session = await host.newSession();
await session.app.open("/");
```

What changes if I want to run the same code against the iOS version? I install `@e2e-dev/mobile`, pick the iOS engine, and give it the bundle ID of the app installed on my simulator:

```ts
import { launch } from "@e2e-dev/core";
import { mobile } from "@e2e-dev/mobile/engine";

await using host = await launch(mobile({ platform: "ios" }), {
  app: { bundleId: "com.example.app" },
  artifactsDir: "./artifacts",
});
await using session = await host.newSession();
await session.app.open();
```

Either way, I now have a `session`. I can call `session.screen.getByRole("button", "Settings").tap()` anywhere the app has that button. The engine handles the click in the browser or the tap on the simulator. You can also pick an [engine for Android, Electron, or a Mac app](https://e2e.com/docs/engines).

## automate browser and mobile navigation with an ai agent

Sometimes I know exactly which button I want. Other times all I want is to get to the notification settings. On the web that might be a link in the sidebar. On a phone it might take three taps through the profile menu. With e2e core, I can define the steps to do that with just plain English and let an AI agent figure out the rest.

To create an agent, give it the session you already have and a model. I'm using Vercel AI Gateway here, so set `AI_GATEWAY_API_KEY` in your environment. Install the AI SDK for the model and Zod for the extraction example below.

```bash
npm install ai zod
```

```ts
import { createAgent } from "@e2e-dev/core/agent";
import { gateway } from "ai";

const agent = createAgent(session, {
  model: gateway("openai/gpt-6-luna-fast"),
  cache: { dir: ".e2e/cache" },
});

await agent.act("Open the notification settings", { cacheKey: "open-notifications" });
await session.screen.getByText("Push notifications", { exact: true }).waitFor();
```

I didn't tell the agent where the menu is. In the code, I just check that “Push notifications” is visible. Once that check passes and the session closes, core saves the actions. The next run can replay them without asking the model how to get back to the same screen. If the UI changes and a recorded action stops working, the agent can take over. That's how the [replay cache](https://e2e.com/docs/cache) works.

## extract structured data from app screens with e2e core

Now that I'm on the right screen, taking an App Store screenshot is one line:

```ts
await session.app.screenshot("notification-settings");
```

Say I want the settings themselves. I can use `agent.extract` with a Zod schema to tell the agent what kind of data I want back:

```ts
import { z } from "zod";

const settings = await agent.extract("the notification options and which ones are enabled", {
  schema: z.array(z.object({ label: z.string(), enabled: z.boolean() })),
});
```

I get back an array I can loop over in the code. Even if the agent got here by replaying yesterday's taps, `extract` reads what's on the screen today.

## wrapping up

What I like about e2e core is how little of the code needs an agent. I can open the app myself. I can save a screenshot myself. The bit I'd usually spend time on is figuring out how to get to the right screen on each platform. Now I can write “open the notification settings” and get on with what I wanted to do there.

To try it, pick your platform in the [e2e core docs](https://e2e.com/docs/core). You can also check out the [full web scraping example on GitHub](https://github.com/e2e-inc/e2e-web-scraper).
