# Browserless Scraper Pro (`datavoyantlab/browserless-scraper-pro`) Actor

Browserless Scraper Pro is designed to automate common web tasks such as web scraping, taking screenshots, and generating PDFs without the need for manual browser interaction.

- **URL**: https://apify.com/datavoyantlab/browserless-scraper-pro.md
- **Developed by:** [DataVoyantLab](https://apify.com/datavoyantlab) (community)
- **Categories:** AI, Automation, Lead generation
- **Features:** Full permissions
- **Stats:** 85 total users, 0 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Simplify Your Web Interactions with Browserless Scraper Pro

Browserless Scraper Pro, inspired by the functionality of Browserless, ScrapingBee ... but tailored to provide a unique, user-friendly experience. This tool is designed to automate common web tasks such as web scraping, taking screenshots, and generating PDFs without the need for manual browser interaction.

### Challenges in Web Interactions for AI

Building AI applications that interact with the web presents several challenges:

- **Dynamic Content**: Modern websites often use client-side rendering and lazy loading, requiring tools that can execute JavaScript and wait for page hydration to access full content.

- **Infrastructure Overhead**: Managing a fleet of headless browsers for scraping at scale involves complexities related to resource contention, reliability, and cold starts.

- **Lack of Web APIs**: Many sites lack proper API access, forcing developers to create and maintain custom scrapers.

This actor is designed to tackle these challenges head-on, providing a robust solution for automating web interactions.

### Key Features

- **Web Scraping**\
  Effortlessly extract data from websites in multiple formats including HTML, readability-enhanced content, cleaned HTML, and Markdown. This feature is perfect for data collection and analysis, allowing users to choose the format that best suits their needs.

- **Screenshot Capture**\
  Obtain high-resolution screenshots of entire web pages or specific sections. This feature includes options for capturing the full page or just the viewport, making it ideal for visual documentation, quality assurance testing, and sharing visuals across teams.

- **PDF Generation**\
  Convert web pages into well-formatted PDF documents with options for custom delays to handle dynamic content. This is suitable for archiving articles, generating reports, or saving web content for offline use.

- **Flexible Proxy Configuration**\
  Configure proxy settings to manage and rotate IPs during scraping activities to avoid detection and blocking by target websites. This feature supports both custom proxies and Apify's built-in proxy solutions.

- **Customizable Delays and Timeouts**\
  Set custom delays between requests to manage scraping speed and comply with website rate limits, ensuring reliable data extraction without overloading the website servers. Additionally, specify a maximum timeout for operations to prevent excessive delays.

- **Comprehensive Output**\
  Receive detailed JSON outputs including HTML content, metadata, and extracted links, which provide insights into the structure and content of the target web pages.

### How It Works

1. **Select the Task**:\
   Choose from scraping data, capturing a screenshot, or generating a PDF.

2. **Submit the URLs**:\
   Provide the URLs of the target webpages.

3. **Customize Options**:\
   Set parameters such as page size for PDFs, full-page or viewport-specific screenshots, scraping selectors, optional delay for operations, and maximum timeout.

4. **Proxy Configuration**:\
   Configure proxy settings if necessary, with a default option to use Apify Proxy (Special apify proxies are not supported yet)

5. **Receive Results**:\
   The tool processes your request and delivers the output in the desired format.

### Usage Examples

#### Web Scraping Input

##### Scrape Input

```json
{
    "operation": "scrape",
    "urls": ["https://example.com", "https://example2.com"],
    "format": "html", // Optional, defaults to 'html'. Other formats available: 'readability', 'cleaned_html', 'markdown'
    "delay": 5000, // Optional, Delay before scraping (in milliseconds)
    "maxTimeout": 30 // Optional, Maximum timeout for the operation (in seconds)
}
```

#### Screenshot Capture Input

```json
{
  "operation": "screenshot",
  "urls": ["https://example.com"],
  "fullPage": true,  // Optional, defaults to false
  "delay": 3000,      // Optional, Delay before scraping (in milliseconds)
  "maxTimeout": 30 // Optional, Maximum timeout for the operation (in seconds)
}
```

#### PDF Generation Input

```json
{
  "operation": "pdf",
  "urls": ["https://example.com"],
  "delay": 3000,      // Optional, Delay before scraping (in milliseconds)
  "maxTimeout": 30 // Optional, Maximum timeout for the operation (in seconds)
}
```

#### Example Output for Web Scraping

Below is an example of the JSON output from a web scraping operation. This output includes the scraped HTML content, metadata about the scrape, and a list of links found on the page.

```json
{
  "content": {
    "html": "<html lang=\"en\" data-theme=\"light\" style=\"color-scheme: light;\"><head>.....</body></html>"
  },
  "metadata": {
    "statusCode": 200,
    "title": "datavoyantlab (DataVoyantLab) · Apify",
    "ogImage": "https://apify.com/og-image/user?username=datavoyantlab",
    "ogTitle": "datavoyantlab (DataVoyantLab) · Apify",
    "urlSource": "https://apify.com/datavoyantlab",
    "description": "🔍 Web Data Extraction Specialist | Building tomorrow's automation tools today | Turning data into decisions 💡",
    "ogDescription": "🔍 Web Data Extraction Specialist | Building tomorrow's automation tools today | Turning data into decisions 💡",
    "language": "en",
    "timestamp": "2025-01-12T22:12:40.497Z"
  },
  "links": [
    {
      "url": "https://apify.com/datavoyantlab#main-content",
      "text": "Skip to content"
    },
    // Additional links omitted for brevity
  ]
}
```

This output is structured to provide comprehensive details about the scraped page, including the HTML content, response status, and various metadata elements like the page title, description, and the original URL. The `links` array contains objects representing links found on the page, each with a URL and the link text.

# Actor input Schema

## `urls` (type: `array`):

The URLs of the websites from which you want to scrape data, take screenshots, or generate PDFs.

## `operation` (type: `string`):

The operation to perform on the page (e.g., 'scrape', 'screenshot', 'pdf').

## `format` (type: `string`):

The format of the output data. Applicable only when the operation is 'scrape'.

## `delay` (type: `integer`):

The delay in milliseconds before the operation is performed.

## `fullPage` (type: `boolean`):

Set to true if a full page screenshot is required.

## `proxy` (type: `object`):

Proxy configuration for the run.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com/datavoyantlab"
  ],
  "operation": "scrape",
  "format": "html",
  "delay": 0,
  "fullPage": false,
  "proxy": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "urls": [
        "https://apify.com/datavoyantlab"
    ],
    "operation": "scrape",
    "format": "html",
    "delay": 0,
    "fullPage": false,
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("datavoyantlab/browserless-scraper-pro").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 = {
    "urls": ["https://apify.com/datavoyantlab"],
    "operation": "scrape",
    "format": "html",
    "delay": 0,
    "fullPage": False,
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("datavoyantlab/browserless-scraper-pro").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 '{
  "urls": [
    "https://apify.com/datavoyantlab"
  ],
  "operation": "scrape",
  "format": "html",
  "delay": 0,
  "fullPage": false,
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call datavoyantlab/browserless-scraper-pro --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datavoyantlab/browserless-scraper-pro"
        }
    }
}
```

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/iObUb6QDjxtp3ISjv/builds/zIs9l1YujIHsZbfcz/openapi.json
