# Framework Compatibility

**Browser Swarm** seamlessly integrates with popular browser automation frameworks, enabling developers to leverage their existing tools while benefiting from our scalable, serverless infrastructure.

***

### 🎭 Playwright

**Playwright** is a modern automation framework supporting multiple browsers and languages.

{% tabs %}
{% tab title="Node.js" %}

```bash
npm install playwright-core browser-swarm-sdk
```

```javascript
import { chromium } from 'playwright-core';
import { createSession } from 'browser-swarm-sdk';

const session = await createSession({ browser: 'chromium' });
const browser = await chromium.connectOverCDP(session.connectUrl);
const page = await browser.newPage();

await page.goto('https://example.com');
await browser.close();
```

{% endtab %}

{% tab title="Python" %}

```bash
pip install playwright browser-swarm
```

{% endtab %}
{% endtabs %}

***

### 🎎 Puppeteer

**Puppeteer** provides a high-level API to control Chrome or Chromium over the DevTools Protocol.

{% tabs %}
{% tab title="Node.js" %}

```bash
npm install puppeteer-core browser-swarm-sdk
```

```javascript
import puppeteer from 'puppeteer-core';
import { createSession } from 'browser-swarm-sdk';

const session = await createSession({ browser: 'chromium' });
const browser = await puppeteer.connect({ browserWSEndpoint: session.connectUrl });
const page = await browser.newPage();

await page.goto('https://example.com');
await browser.close();
```

{% endtab %}
{% endtabs %}

***

### 🧪 Selenium

**Selenium** is a widely-used framework for automating web applications across different browsers.

{% tabs %}
{% tab title="Node.js" %}

```bash
npm install selenium-webdriver browser-swarm-sdk
```

{% endtab %}

{% tab title="Python" %}

```bash
pip install selenium browser-swarm
```

```python
from selenium import webdriver
from browser_swarm import create_session

session = create_session(browser='chrome')
options = webdriver.ChromeOptions()
options.add_experimental_option('debuggerAddress', session.connect_url)

driver = webdriver.Chrome(options=options)
driver.get('https://example.com')
driver.quit()
```

{% endtab %}
{% endtabs %}

***

By integrating **Browser Swarm** with these frameworks, you can enhance your automation capabilities with scalable, reliable, and efficient browser sessions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://browserswarm.gitbook.io/docs/framework-compatibility.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
