# Headless Browser

Headless Browser allows you to run and control remote headless browsing experience without the complexity of managing them locally or on your own infrastructure. It provides a seamless way to execute browser-based automation, testing, and web scraping without dealing with browser setup, resource constraints, or detection challenges.&#x20;

### Supported Libraries

Headless Browser works with any library that supports the **Chrome DevTools Protocol (CDP)**. This includes:

* [Playwright](https://playwright.dev/) (for Firefox, supported Playwright versions are 1.51 and 1.56)
* [Puppeteer](https://pptr.dev/)
* Other CDP-compatible automation frameworks

### Browser Options

Headless Browser offers two specialized browser environments:

* [Chrome-based browser](https://developers.oxylabs.io/scraping-solutions/headless-browser/chrome) – high-performance remote browsers with advanced stealth running on dedicated servers with integrated proxies
* [Firefox-based browser](https://developers.oxylabs.io/scraping-solutions/headless-browser/firefox) (Legacy) - Firefox implementation with built-in anti-detection features and proxy integration. Please note this environment will be deprecated soon.

Additionally, Headless Browser allows two location-related functionalities:

* Performance optimization for the US-based users,
* Geo-location parameters for country, city and state level targeting.

### **Rate Limits**

Each has **100 concurrent sessions** and can launch up to **10 sessions per second for each browser** (Chrome and Firefox). This ensures service stability and performance.

To request a higher limit for your account, contact Oxylabs Customer Support via [live chat](https://oxylabs.drift.click/oxybot) or [email](mailto:support@oxylabs.io).

### Quick Start Examples

{% tabs %}
{% tab title="Python" %}

```python
from playwright.sync_api import sync_playwright

username = "your-username"
password = "your-password"
endpoint = "ubc.oxylabs.io"
browser_url = f"wss://{username}:{password}@{endpoint}"

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(browser_url)
    page = browser.new_page()
    page.goto('https://example.com')
    print(page.title())
    browser.close()
```

{% endtab %}

{% tab title="JavaScript (Playwright)" %}

```javascript
import { chromium } from 'playwright';

(async () => {
    const username = 'your-username';
    const password = 'your-password';
    const endpoint = 'ubc.oxylabs.io';
    const browserUrl = `wss://${username}:${password}@${endpoint}`;

    const browser = await chromium.connectOverCDP(browserUrl);
    const page = await browser.newPage();
    await page.goto('https://example.com');
    console.log(await page.title());
    await browser.close();
})();
```

{% endtab %}

{% tab title="JavaScript (Puppeteer)" %}

```javascript
import puppeteer from 'puppeteer';

(async () => {
  const username = 'your-username';
  const password = 'your-password';
  const endpoint = 'ubc.oxylabs.io';
  const browserUrl = `wss://${username}:${password}@${endpoint}`;

  const browser = await puppeteer.connect({
    browserWSEndpoint: browserUrl
  });
  const page = await browser.newPage();
  await page.goto('https://example.com');
  console.log(await page.title());
  await browser.close();
})();
```

{% endtab %}
{% endtabs %}

See the browser-specific documentation for detailed configuration options:

* [Chrome-based browser](https://developers.oxylabs.io/scraping-solutions/headless-browser/chrome)
* [Firefox-based browser](https://developers.oxylabs.io/scraping-solutions/headless-browser/firefox) (Legacy)


---

# 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://developers.oxylabs.io/scraping-solutions/headless-browser.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.
