Dashboard

Selenium

Connect Selenium WebDriver to a Scrayle cloud browser for stealth-enabled automation. The SDK provisions a session on the internal grid and returns a ready WebDriver - no grid setup required.

Prerequisites

npm install @scrayle/sdk

The SDK includes selenium-webdriver as a dependency. No separate installation is needed.

Cloud Browser

Use SeleniumBrowser.connect() to provision a Scrayle-managed Selenium session:

import { SeleniumBrowser } from '@scrayle/sdk';

const driver = await SeleniumBrowser.connect({
  apiKey: process.env.SCRAYLE_API_KEY,
});

await driver.get('https://example.com');
console.log(await driver.getTitle());
await driver.quit();

With Proxy

const driver = await SeleniumBrowser.connect({
  apiKey: process.env.SCRAYLE_API_KEY,
  proxyCountry: 'US',
});

await driver.get('https://example.com');
await driver.quit();

All Connect Options

OptionTypeDefaultDescription
apiKeystringSCRAYLE_API_KEYScrayle API key
scrayleHubstringeuCompute hub: eu, us, asia
proxyCountrystring-Proxy exit country (e.g. US, GB)
proxyPoolIdstring-ID of a saved proxy pool
sessionNamestring-Label shown in the dashboard
headlessbooleantrueRun in headless mode
windowSizeobject1280x800Browser window dimensions
sessionTTLnumber300000Session lifetime in ms (max per plan)

Stealth Features

All Selenium sessions include the same CDP-based stealth patches as Playwright and Puppeteer sessions:

Local / Self-hosted

Use SeleniumBrowser.launch() to drive a local Chromium binary or a self-hosted Selenium Grid:

import { SeleniumBrowser } from '@scrayle/sdk';

// Local Chromium - auto-detected from common binary paths
const driver = await SeleniumBrowser.launch({ headless: true });

// Self-hosted grid
const driver = await SeleniumBrowser.launch({
  remoteUrl: 'http://your-selenium-grid:4444',
});

await driver.get('https://example.com');
await driver.quit();

launch() does not use Scrayle cloud credits. Credits are only consumed by connect() sessions.