TheBomb®
TheBomb® Logo
Start Project
Insight
126k Views
433 Shares

How to Automate Browser Tasks with OpenClaw: Web Scraping & Beyond

Learn how to use OpenClaw browser automation to scrape websites, fill forms, take screenshots, and automate repetitive web tasks — all from your messaging app.

TheBomb®

Cody New

TheBomb® Editorial

Browser window controlled by AI with automated cursor movements and highlighted DOM elements

What if you could tell your AI assistant “go to this website, grab the pricing data, and put it in a spreadsheet” — and it just did it? That’s exactly what OpenClaw’s browser automation tool enables.

In this tutorial, we’ll set up OpenClaw’s browser tool, walk through real-world automation examples, and build reusable skills for common web tasks.


How OpenClaw Browser Automation Works

OpenClaw uses a headless Chromium browser under the hood. When you enable the browser tool, your AI assistant can:

  • Navigate to any URL
  • Read and extract page content
  • Click buttons and fill forms
  • Take screenshots
  • Execute JavaScript on the page
  • Wait for dynamic content to load

All of this is orchestrated through natural language — you describe what you want, and OpenClaw translates it into browser actions.


Prerequisites

  • OpenClaw installed and running (installation guide)
  • Chromium or Google Chrome installed on the host machine
  • At least 1GB of free RAM (headless browsers are resource-hungry)

Step 1: Enable the Browser Tool

The browser tool is disabled by default for security. Enable it in your config:

# ~/.openclaw/config.yaml
tools:
  browser:
    enabled: true
    headless: true          # Run without visible window
    timeout_ms: 30000       # Max wait time per action
    viewport:
      width: 1920
      height: 1080
    user_agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
    screenshot_path: "/home/openclaw/workspace/screenshots"
    # Security: block certain domains
    blocked_domains:
      - "*.banking.com"
      - "*.gov"

Restart the gateway:

openclaw gateway restart

Docker Users: Additional Setup

If running OpenClaw in Docker, you need to install Chromium in the container. Update your Dockerfile:

# Add to your Dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends \
    chromium \
    fonts-liberation \
    libnss3 \
    libatk-bridge2.0-0 \
    libdrm2 \
    libxcomposite1 \
    libxdamage1 \
    libxrandr2 \
    libgbm1 \
    libpango-1.0-0 \
    libcairo2 \
    libasound2 \
    && rm -rf /var/lib/apt/lists/*

ENV CHROMIUM_PATH=/usr/bin/chromium

Step 2: Basic Browser Commands

Once enabled, you can give OpenClaw browser instructions through any connected channel. Here are some examples:

Read a Web Page

Go to https://news.ycombinator.com and tell me the top 5 stories

OpenClaw will navigate to the page, extract the content, and summarize the top stories.

Take a Screenshot

Take a screenshot of https://example.com and send it to me

The browser tool captures the viewport and sends the image back through your messaging channel.

Extract Structured Data

Go to https://books.toscrape.com, extract the title and price of every book on the first page, and format it as a markdown table

Step 3: Build a Price Monitoring Skill

Let’s create a practical skill that monitors product prices:

# ~/.openclaw/skills/price-monitor.yaml
name: price-monitor
description: "Monitors product prices and alerts on changes"
version: 1.0

requires:
  - browser
  - file_access

trigger:
  type: cron
  schedule: "0 */6 * * *"  # Every 6 hours

channel: telegram

instructions: |
  Monitor prices for the products listed in 
  ~/.openclaw/data/watchlist.json

  For each product:
  1. Navigate to the product URL
  2. Extract the current price using the CSS selector provided
  3. Compare with the last recorded price in the watchlist
  4. If the price dropped by more than 5%, send an alert

  Alert format:
  🔔 **Price Drop Alert!**
  Product: [name]
  Old Price: $XX.XX
  New Price: $YY.YY
  Savings: $ZZ.ZZ (XX%)
  Link: [url]

  After checking all products, update watchlist.json with 
  current prices and timestamps.

Create the watchlist data file:

{
  "products": [
    {
      "name": "Sony WH-1000XM6 Headphones",
      "url": "https://example-store.com/sony-xm6",
      "selector": ".product-price .current",
      "last_price": 449.99,
      "last_checked": null
    },
    {
      "name": "Mechanical Keyboard Kit",
      "url": "https://example-store.com/mech-kb",
      "selector": "[data-price]",
      "last_price": 189.00,
      "last_checked": null
    }
  ]
}
mkdir -p ~/.openclaw/data
# Save the above JSON to ~/.openclaw/data/watchlist.json

openclaw skill enable price-monitor

Step 4: Form Filling Automation

OpenClaw can fill and submit web forms. Here’s a skill for automated form submissions:

# ~/.openclaw/skills/form-filler.yaml
name: form-filler
description: "Fills web forms based on natural language instructions"
version: 1.0

requires:
  - browser

instructions: |
  When asked to fill a form:

  1. Navigate to the specified URL
  2. Wait for the form to fully load (wait for the submit button)
  3. Identify all form fields (input, select, textarea)
  4. Map the user's data to the appropriate fields
  5. Fill each field using the proper method:
     - Text inputs: type into the field
     - Dropdowns: select the matching option
     - Checkboxes: click to toggle
     - Radio buttons: click the correct option
     - File uploads: use the provided file path
  6. Take a screenshot BEFORE submitting for user review
  7. Only submit if the user confirms

  SAFETY RULES:
  - NEVER submit payment forms without explicit approval
  - NEVER fill in passwords or sensitive credentials
  - Always show a preview screenshot before submission

Usage via Telegram:

Fill out the contact form at https://example.com/contact with:
Name: John Doe
Email: [email protected]
Subject: Partnership Inquiry
Message: We'd love to discuss collaboration...

OpenClaw will fill the form, send you a screenshot for review, and only submit after your confirmation.


Step 5: Competitive Analysis Automation

# ~/.openclaw/skills/competitor-watch.yaml
name: competitor-watch
description: "Monitors competitor websites for changes"
version: 1.0

requires:
  - browser
  - file_access
  - web_search

trigger:
  type: cron
  schedule: "0 9 * * 1"  # Every Monday at 9 AM

channel: telegram

instructions: |
  Perform weekly competitor analysis:

  1. For each competitor URL in ~/.openclaw/data/competitors.json:
     a. Navigate to the URL
     b. Take a full-page screenshot
     c. Extract key content (pricing, features, headlines)
     d. Compare with the previous week's snapshot

  2. Generate a report highlighting:
     - New features or products
     - Pricing changes
     - Design or messaging changes
     - New blog posts or content

  3. Save screenshots to ~/workspace/competitor-snapshots/[date]/
  4. Send a summary report to the configured channel

Performance Tips

Limit Concurrent Browser Sessions

tools:
  browser:
    max_concurrent_sessions: 2
    session_timeout_ms: 60000

Block Unnecessary Resources

Speed up page loads by blocking images, fonts, and tracking scripts:

tools:
  browser:
    block_resources:
      - "*.png"
      - "*.jpg"
      - "*.gif"
      - "*.woff2"
      - "*google-analytics*"
      - "*facebook*"

Cache DNS Lookups

tools:
  browser:
    dns_cache: true
    dns_cache_ttl: 3600

Security Considerations

Browser automation is powerful — and dangerous if misconfigured:

  • Blocked domains: Always block banking, government, and sensitive sites
  • Screenshot review: Require screenshots before form submissions
  • Rate limiting: Respect website terms of service
  • User-agent rotation: Don’t spoof user agents for malicious purposes
  • Data storage: Auto-delete scraped data after processing
tools:
  browser:
    security:
      require_approval_for:
        - form_submission
        - file_download
        - javascript_execution
      auto_delete_screenshots_after: "7d"

Conclusion

Browser automation turns OpenClaw into a versatile web agent that can handle research, monitoring, data extraction, and repetitive form tasks. Combined with scheduled triggers, it becomes a hands-off automation engine for the modern web.

Need custom browser automation workflows? Our team builds enterprise-grade web automation solutions powered by AI.

Reading Time

6 Minutes

Category

Development