# Browserless

Browserless is a service that provides headless browser automation, allowing users to run automations on their own sites with browser infrastructure.

- **Category:** developer tools
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 7
- **Triggers:** 0
- **Slug:** `BROWSERLESS`
- **Version:** 20260312_00

## Tools

### Download file using Puppeteer script

**Slug:** `BROWSERLESS_DOWNLOAD_FILE`

This tool allows downloading files that Chrome has downloaded during the execution of puppeteer code. It sets up a blank page, creates a fresh download directory, injects the provided code, and executes it. Once the script finishes, any downloaded files from Chromium are returned with the appropriate content-type header.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `code` | string | Yes | The Puppeteer script to execute for downloading the file. This should be a valid JavaScript code that triggers a file download. |
| `context` | object | No | Additional context data to be passed to the script |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Execute Custom Function

**Slug:** `BROWSERLESS_EXECUTE_CUSTOM_FUNCTION`

A tool that allows executing custom Puppeteer scripts via HTTP requests. This endpoint enables users to run browser automation tasks without managing their own infrastructure.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `code` | string | Yes | The Puppeteer function code to execute. Must be a valid ESM module with a default export function. |
| `context` | object | No | Optional context object to pass to the function. Supports any JSON-serializable nested data. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Fetch HTML Content

**Slug:** `BROWSERLESS_FETCH_HTML_CONTENT`

This tool fetches the complete HTML content of a webpage using Browserless's content API. It's designed to retrieve the full HTML contents of any website, including dynamically generated content.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | The URL of the webpage to fetch HTML content from |
| `best_attempt` | boolean | No | Whether to continue on error |
| `goto_options` | object | No | Navigation options like waitUntil |
| `wait_for_event` | object | No | Wait for specific event with optional timeout |
| `wait_for_timeout` | integer | No | Wait for specific time in milliseconds |
| `wait_for_selector` | object | No | Wait for specific element with optional timeout |
| `reject_resource_types` | array | No | Types of resources to block (e.g., images, stylesheets) |
| `reject_request_pattern` | array | No | Patterns to block specific requests |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Generate PDF from webpage

**Slug:** `BROWSERLESS_GENERATE_PDF`

This tool generates a PDF from a specified webpage using browserless's PDF generation API. It allows specifying the URL of the webpage along with parameters such as format, filename, and waitUntil options to control the PDF generation process.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | No | URL of the webpage to generate PDF from |
| `html` | string | No | HTML content to generate PDF from |
| `options` | object | No | PDF generation options based on Puppeteer's PDFOptions. |
| `addStyleTag` | array | No | Custom style tags to inject |
| `bestAttempt` | boolean | No | Continue on error |
| `gotoOptions` | object | No | Navigation options for page loading. |
| `addScriptTag` | array | No | Custom script tags to inject |
| `waitForSelector` | object | No | Options for waiting for a selector to appear. |
| `rejectResourceTypes` | array | No | Resource types to block |
| `rejectRequestPattern` | array | No | Request patterns to block |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Scrape webpage content using CSS selectors

**Slug:** `BROWSERLESS_SCRAPE_CONTENT`

A tool to extract structured content from a webpage by specifying CSS selectors. The tool navigates to the specified URL, waits for the page to load (including parsing and executing JavaScript), and returns the selected elements in a structured JSON format.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | The URL to scrape content from |
| `elements` | array | Yes | Array of objects containing CSS selectors to extract |
| `gotoOptions` | object | No | Options for page navigation |
| `waitForEvent` | object | No | Wait for a specific event to occur |
| `waitForTimeout` | integer | No | Wait specified milliseconds before scraping |
| `waitForFunction` | object | No | Wait for a custom JavaScript function to return true |
| `waitForSelector` | object | No | Wait for a specific selector to appear |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Take Screenshot

**Slug:** `BROWSERLESS_TAKE_SCREENSHOT`

A tool that captures a screenshot of a webpage using browserless's screenshot API. The tool takes a URL and returns either a PNG or JPEG image. It includes options for full page capture, image type, quality, and clipping coordinates.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | The URL of the webpage to capture |
| `clip_x` | integer | No | X coordinate for clipping the screenshot |
| `clip_y` | integer | No | Y coordinate for clipping the screenshot |
| `quality` | integer | No | The quality of the image (0-100, only applies to jpeg) |
| `full_page` | boolean | No | Whether to capture the full page or just the viewport |
| `clip_width` | integer | No | Width of the clipping area |
| `image_type` | string ("png" | "jpeg") | No | The type of image to return (png or jpeg) |
| `clip_height` | integer | No | Height of the clipping area |
| `omit_background` | boolean | No | Whether to omit the background in the screenshot |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Unblock Protected Content

**Slug:** `BROWSERLESS_UNBLOCK_PROTECTED_CONTENT`

This tool provides access to content from websites that implement bot protection mechanisms. It is designed to bypass various types of protection (such as CAPTCHA and bot detections) and return the HTML content of the protected webpage, with optional customization through parameters like waitFor, timeout, and stealth mode.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `ttl` | integer | No | Time to live for the browser instance in milliseconds |
| `url` | string | Yes | The URL of the protected webpage to access |
| `content` | boolean | No | Whether to return the HTML content of the page |
| `cookies` | boolean | No | Whether to return cookies from the page |
| `screenshot` | boolean | No | Whether to return a screenshot of the page |
| `waitForEvent` | object | No | Event to wait for before returning the response |
| `waitForFunction` | object | No | Function to execute and wait for before returning the response |
| `waitForSelector` | object | No | Selector to wait for before returning the response |
| `browserWSEndpoint` | boolean | No | Whether to return a WebSocket endpoint for browser automation |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
