Anchor Browser delivers a state-of-the-art 89% Score on the industry-standard benchmark WebVoyager, leveraging browser-use as a core component of the automation capability.
Anchor Browser comes with an embedded AI component, that allows to control the browser or extract data using natural language.This capability allows to use the browser without any coding.For basic usage, the Perform Web Task Tool exposes these capabilities through a single API request.For advanced usage, use it through the playwright CDP connection (all languages supported by PW are supported)
import { chromium } from "playwright-core";const browserSession = await chromium.connectOverCDP(`wss://connect.anchorbrowser.io?apiKey=ANCHOR-API-KEY`);const context = browser.contexts()[0];const ai = context.serviceWorkers()[0];const page = context.pages()[0];// Combine regular playwright and AI actions to benefit from both optionsawait page.goto("http://docs.anchorbrowser.io/", {waitUntil:'domcontentloaded'});// Use the embedded 'ai' objectconst result = await ai.evaluate('Find the last game played by Milwaukee in the NBA and return the result')console.log(result);
The AI object can also be used to extract structured data from the browser. This is done by providing a JSON schema to the AI object, which will then return the structured data.
The following demonstrates using Zod and Pydantic to utilize the structured output capability.
Copy
Ask AI
import { chromium } from 'playwright';import { z } from "zod";import { zodToJsonSchema } from "zod-to-json-schema";const browser = await chromium.connectOverCDP("wss://connect.anchorbrowser.io?apiKey=ANCHOR-API-KEY");const context = browser.contexts()[0];const ai = context.serviceWorkers()[0];const page = context.pages()[0];const outputSchema = z.object({ nodes_cpu_usage: z.array( z.object({ node: z.string(), cluster: z.string(), cpu_avg_percentage: z.number(), }) )});const jsonSchema = zodToJsonSchema(outputSchema);const taskPayload = { output_schema: jsonSchema, prompt: 'Collect the node names and their CPU average %',};await page.goto("https://play.grafana.org/a/grafana-k8s-app/navigation/nodes?from=now-1h&to=now&refresh=1m");const result = await ai.evaluate(JSON.stringify(taskPayload));console.info(result);