# Puppeteer Browser Automation Runner (`produkdigitalali/puppeteer-browser-automation-runner`) Actor

Run declarative browser automation workflows with Puppeteer, including navigation, clicks, form input, extraction, assertions, and screenshots.

- **URL**: https://apify.com/produkdigitalali/puppeteer-browser-automation-runner.md
- **Developed by:** [ProdukDigitalAli](https://apify.com/produkdigitalali) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### What is Puppeteer Browser Automation Runner?

Puppeteer Browser Automation Runner executes safe, declarative browser workflows in the Apify cloud using Puppeteer and Chrome.

Instead of writing and hosting a complete Puppeteer application, define an ordered list of actions such as navigation, clicks, form input, extraction, assertions, waits, and screenshots. The Actor executes the workflow and stores one structured Dataset row per step.

It is designed for browser automation, repetitive web workflows, smoke monitoring, lightweight extraction, and integration into scheduled or API-driven pipelines.

### Supported actions

- `goto` - navigate to the target URL or another public HTTP(S) URL
- `waitForSelector` - wait until a CSS selector exists
- `click` - click an element
- `type` - type text into a field
- `select` - select an option in a `<select>` element
- `extractText` - return an element's text content
- `extractAttribute` - return an HTML attribute such as `href` or `src`
- `wait` - pause the workflow for a specified number of milliseconds
- `screenshot` - capture a screenshot and save it to the run Key-Value Store
- `textContains` - assert that visible page text contains a value
- `urlContains` - assert that the current URL contains a value
- `titleContains` - assert that the page title contains a value

### Example input

```json
{
  "targetUrl": "https://example.com",
  "workflowName": "Example.com workflow",
  "actions": [
    {
      "type": "goto",
      "label": "Open target page"
    },
    {
      "type": "waitForSelector",
      "label": "Wait for heading",
      "selector": "h1"
    },
    {
      "type": "extractText",
      "label": "Extract heading",
      "selector": "h1"
    },
    {
      "type": "textContains",
      "label": "Check expected text",
      "value": "Example Domain"
    },
    {
      "type": "screenshot",
      "label": "Capture page"
    }
  ]
}
```

### Example output

Each executed step is stored as a separate Dataset item:

```json
{
  "workflowName": "Example.com workflow",
  "targetUrl": "https://example.com",
  "step": 3,
  "action": "extractText",
  "label": "Extract heading",
  "passed": true,
  "currentUrl": "https://example.com/",
  "value": "Example Domain",
  "error": null,
  "screenshotUrl": null
}
```

Failed steps are also stored, with `passed: false` and an error message. Depending on the input settings, the workflow can stop on the first failure or continue with later steps.

### Screenshots and artifacts

Explicit `screenshot` actions always save a PNG to the run's default Key-Value Store and return its URL in the Dataset.

You can also configure automatic screenshots:

- on failed steps
- after every step
- only for explicit screenshot actions

### Use cases

#### Browser workflow automation

Automate predictable sequences of navigation, clicks, form entry, and page interactions without deploying your own browser infrastructure.

#### Website monitoring

Schedule workflows to verify important text, URLs, selectors, or page titles and inspect failure screenshots.

#### Lightweight web extraction

Extract text or attributes from JavaScript-rendered websites and send structured results to another system through the Apify API.

#### Repetitive QA workflows

Automate browser checks that do not require a full Cypress or Playwright test suite.

#### Data and AI pipelines

Use the Actor as a browser-action component inside scheduled workflows, backend services, or AI-driven pipelines.

### API and scheduling

The Actor can be run from the Apify Console, the Apify API, schedules, webhooks, and integrations.

Because every workflow step is written to the default Dataset, downstream systems can consume results as JSON, CSV, Excel, XML, or through the Dataset API.

### Safety model

This Actor intentionally uses declarative actions instead of arbitrary user-supplied JavaScript.

For security, requests to localhost, loopback addresses, link-local addresses, and common private-network IP ranges are blocked. Only public HTTP(S) destinations are intended to be used.

### Important limitations

- Dynamic websites can change their selectors and behavior over time.
- Some websites use bot protection that can block automated browsers.
- Login flows with CAPTCHA or complex multi-factor authentication may require a more specialized solution.
- `waitForNavigation` should only be enabled for clicks that are expected to trigger a real page navigation.
- The Actor is intended for public websites and does not provide access to private networks.

### Responsible use

Only automate websites and data you are authorized to access. Follow applicable laws, website terms, privacy requirements, and rate limits.

This is an independent automation tool built with the open-source Puppeteer library. It is not affiliated with or endorsed by Google, Chrome, or the Puppeteer project.

### Support

When reporting an issue, include:

- the public target URL
- a sanitized version of the workflow input
- the failing step number
- the error shown in the Dataset

Do not include passwords, API keys, private cookies, or other secrets in public issues.

# Actor input Schema

## `targetUrl` (type: `string`):

Public HTTP(S) URL used by goto actions that do not specify their own URL.

## `workflowName` (type: `string`):

Human-readable name used in result rows and the run summary.

## `actions` (type: `array`):

Ordered browser actions. Fill only the fields relevant to each selected action type.

## `navigationTimeoutSeconds` (type: `integer`):

Default timeout for page navigation, in seconds.

## `actionTimeoutSeconds` (type: `integer`):

Default timeout for selectors and browser actions, in seconds.

## `viewportWidth` (type: `integer`):

Browser viewport width in pixels.

## `viewportHeight` (type: `integer`):

Browser viewport height in pixels.

## `stopOnError` (type: `boolean`):

Stop the workflow after the first failed step. Disable to collect results from later steps when possible.

## `screenshotMode` (type: `string`):

Choose when screenshots are captured automatically. Explicit screenshot actions always capture one.

## `fullPageScreenshots` (type: `boolean`):

Capture the full scrollable page for automatic screenshots.

## `userAgent` (type: `string`):

Optional custom browser user-agent string. Leave empty to use Puppeteer's default.

## Actor input object example

```json
{
  "targetUrl": "https://example.com",
  "workflowName": "Example.com browser workflow",
  "actions": [
    {
      "type": "goto",
      "label": "Open target page"
    },
    {
      "type": "waitForSelector",
      "label": "Wait for H1",
      "selector": "h1"
    },
    {
      "type": "extractText",
      "label": "Extract H1 text",
      "selector": "h1"
    },
    {
      "type": "screenshot",
      "label": "Capture final screenshot"
    }
  ],
  "navigationTimeoutSeconds": 30,
  "actionTimeoutSeconds": 15,
  "viewportWidth": 1365,
  "viewportHeight": 768,
  "stopOnError": true,
  "screenshotMode": "onFailure",
  "fullPageScreenshots": false,
  "userAgent": ""
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("produkdigitalali/puppeteer-browser-automation-runner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("produkdigitalali/puppeteer-browser-automation-runner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call produkdigitalali/puppeteer-browser-automation-runner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,produkdigitalali/puppeteer-browser-automation-runner"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ArBphZtthu3jyPiC5/builds/KRpSrZ1y7uG9t4Kpy/openapi.json
