Portal Community

Example 1: Capture a Screenshot of a Dashboard for Weekly Email Report

Scenario: Every Monday, capture a full-page screenshot of an internal analytics dashboard and attach it to a weekly stakeholder email.

{
  "operation": "screenshot",
  "api_token": "{{ credentials.browserless_token }}",
  "url": "{{ vars.dashboard_url }}",
  "cookies": [
    { "name": "session_token", "value": "{{ credentials.dashboard_session }}", "domain": "dashboard.acme.com" }
  ],
  "viewport": { "width": 1440, "height": 900, "deviceScaleFactor": 2 },
  "wait_for_selector": ".chart-container.loaded",
  "wait_for_timeout_ms": 2000,
  "full_page": true,
  "type": "png"
}
Expected outcome: A high-resolution full-page PNG of the authenticated dashboard is returned as base64. Pass data to an EmailSmtp node as an inline attachment for the weekly stakeholder email.

Example 2: Generate a PDF Invoice from HTML Template

Scenario: After an order is completed, render an HTML invoice template as a PDF and attach it to the order confirmation email.

{
  "operation": "pdf",
  "api_token": "{{ credentials.browserless_token }}",
  "html": "{{ vars.invoice_html_template }}",
  "format": "A4",
  "print_background": true,
  "emulate_media_type": "print",
  "margin_top": "15mm",
  "margin_bottom": "15mm",
  "margin_left": "20mm",
  "margin_right": "20mm"
}
Expected outcome: A properly formatted A4 PDF with print stylesheet applied is returned as base64. The margins produce clean white borders. Pass to an EmailSmtp node as a invoice_{{ vars.order_id }}.pdf attachment.

Example 3: Scrape Product Prices from Competitor Website

Scenario: Every day at 7 AM, extract current prices from a competitor's product listing page and compare with your own prices.

{
  "operation": "scrape",
  "api_token": "{{ credentials.browserless_token }}",
  "url": "{{ vars.competitor_catalog_url }}",
  "block_ads": true,
  "wait_for_selector": ".product-grid",
  "goto_options": { "waitUntil": "networkidle2" },
  "elements": [
    {
      "selector": ".product-card",
      "results": [
        { "type": "text" },
        { "type": "attribute", "attribute": "data-product-id" }
      ]
    },
    {
      "selector": ".product-card .price",
      "results": [
        { "type": "text" },
        { "type": "attribute", "attribute": "data-price" }
      ]
    }
  ]
}
Expected outcome: Returns structured arrays of product names and prices. Connect to a Loop node to compare each competitor price against your stored prices and flag items where the difference exceeds a threshold.

Example 4: Block Images and Fonts to Speed Up Content Scraping

Scenario: Scrape article text from a content-heavy news site as fast as possible. Images and web fonts are not needed — blocking them cuts page load time significantly.

{
  "operation": "content",
  "api_token": "{{ credentials.browserless_token }}",
  "url": "{{ vars.article_url }}",
  "reject_resource_types": ["image", "media", "font"],
  "reject_request_pattern": ["analytics.google.com", "doubleclick.net", "facebook.com"],
  "block_ads": true,
  "javascript_enabled": false,
  "goto_options": { "waitUntil": "domcontentloaded", "timeout": 15000 }
}
Expected outcome: Page HTML is returned in 1-3 seconds instead of 8-15 seconds. The text content is fully available for parsing by a downstream Function or DataMapping node. Ad requests and tracking pixels are also blocked, reducing noise.

Example 5: Run Lighthouse Performance Audit on Production Site

Scenario: After every production deployment, run a Lighthouse audit and send a Slack alert if the performance score drops below 80.

// Step 1 — Browserless performance audit
{
  "operation": "performance",
  "api_token": "{{ credentials.browserless_token }}",
  "url": "{{ vars.production_url }}"
}

// Step 2 — IfCondition: categories.performance.score * 100 < 80
//   → true branch:

// Step 3 — Slack/message/send
{
  "channel": "#engineering",
  "text": "Performance regression detected on {{ vars.production_url }}\nScore: {{ nodes.step1.categories.performance.score * 100 | round }}%\nLCP: {{ nodes.step1.audits.largest-contentful-paint.displayValue }}\nFCP: {{ nodes.step1.audits.first-contentful-paint.displayValue }}"
}
Expected outcome: Each deployment triggers an automated Lighthouse audit. If performance drops below the threshold, the engineering team receives a Slack message with the specific metrics that regressed. No manual auditing is needed.