Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
JavaScript browser automation libraries control a web browser from code to open pages, click, type, and read content. Each command travels to the browser over a protocol such as WebDriver BiDi or the Chrome DevTools Protocol. These libraries run end-to-end tests, scrape pages that need JavaScript, and give AI agents a browser they can operate.
Popularity
playwright-core has the most monthly downloads in this comparison, at 712.5M.
private async activeWindowHandle(): Promise<string> {
try {
return await this.browser.getWindowHandle();
}
catch (error) {
// If the window is closed by user action Webdriver will still hold the reference to the closed window. if (['NoSuchWindowError', 'no such window'].includes(error.name)) {
const allHandles = await this.browser.getWindowHandles();
if (allHandles.length > 0) {
const handle = allHandles.at(-1);
await this.browser.switchToWindow(handle);
return handle;
}
}
throw error;
}
}
chrome-remote-interface
Sends Chrome DevTools Protocol commands to a running Chrome target.
async _loadPage(client) {
// enable domains const {Page, Network} = client;
await Network.enable();
await Page.enable();
// register events const stats = new Stats(this._url, this._options);
const termination = new Promise((fulfill, reject) => {
client.on('event', (event) => {
stats.processEvent(fulfill, reject, event);
});
// XXX the separation of concerns between live fetching and HAR // computation made it necessary to introduce a synthetic event // which is the reply of the Network.getResponseBody method if (this._options.content) {
Network.loadingFinished(async ({requestId}) => {
// only for those entries that are being tracked (e.g., not // for cached items) if (!stats.entries.get(requestId)) {
return;
}
try {
const params = await Network.getResponseBody({requestId});
const {body, base64Encoded} = params;
stats.processEvent(fulfill, reject, {
method: 'Network.getResponseBody',
params: {
requestId,
body,
base64Encoded
}
});
} catch (err) {
// sometimes it is impossible to fetch the content (see #82) stats.processEvent(fulfill, reject, {
method: 'Network.getResponseBody',
params: {
requestId
}
});
}
});
}
});
// start the page load const navigation = Page.navigate({url: this._url});
// events will determine termination await Promise.all([termination, navigation]);
return stats;
}
Stagehand
Builds browser agents on Browserbase's SDK, with model-guided page actions.
async _startRemoteBrowser(runner) {
const remoteConnection = await this.testcafe.createBrowserConnection()
console.log('Connect your device to the following URL or scan QR Code: ', remoteConnection.url)
qrcode.generate(remoteConnection.url)
remoteConnection.once('ready', () => {
runner
.src(this.dummyTestcafeFile)
.browsers(remoteConnection)
.reporter('minimal')
.run({
selectorTimeout: this.options.waitForTimeout,
skipJsErrors: true,
skipUncaughtErrors: true,
})
.catch(err => {
this.debugSection('_before', `Error ${err.toString()}`)
this.isRunning = false
this.testcafe.close()
})
})
}
FAQ
Playwright locators wait until an element is ready before acting. Selenium WebDriver leaves waits to the test code and drives browsers through the WebDriver protocol, locally or on Selenium Grid.
Puppeteer controls Chrome and Firefox and can attach to a running browser endpoint. Playwright drives several browsers through one API and checks each element's actionability before an action.
Stagehand adds model-guided actions, where a language model decides how to act on the page. Playwright runs only the actions the code specifies.
Locators wait for the element to be present and in the right state for the action.The checks include viewport, visibility, enabled state, and a stable bounding box.
The connecting client and browser-launching Playwright instance must have matching major and minor versions.
Network mocking in WebdriverIO requires WebDriver BiDi support in the browser or remote provider.
For coding agents
Found your browser automation library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.