Productivity Tutorial25 min read

Browser Automation with Moltbot

Let Moltbot control your browser. Automate form filling, data scraping, price monitoring, shopping workflows, and any repetitive web taskโ€”freeing you to focus on what matters.

What You Can Automate

Browser automation unlocks countless possibilities. Here are the most popular use cases from the Moltbot community:

Form Filling

Auto-fill job applications, government forms, registrations with your saved data

Data Scraping

Extract prices, inventory, news, or research data from any website

Shopping Automation

Price monitoring, stock alerts, and even automated checkout for limited releases

Report Generation

Download reports, generate PDFs, and compile data from web dashboards

Scheduled Tasks

Daily checks, weekly reports, or any recurring web-based workflow

Testing & Monitoring

Website uptime checks, visual regression testing, performance monitoring

Natural Language Control

Control the browser through simple chat commands. No coding required for basic tasks:

๐Ÿ‘ค

You

Check the price of iPhone 15 Pro on Amazon and Best Buy, tell me which is cheaper

๐Ÿฆž

Moltbot

๐Ÿ” Price comparison complete:

Amazon$1,099
Best Buy$1,049 โœ…

Best Buy is $50 cheaper. Both have the phone in stock (256GB, Natural Titanium).

๐Ÿ‘ค

You

Fill out the contact form on acme-corp.com with my info and submit it

๐Ÿฆž

Moltbot

โœ… Form submitted successfully!

I've filled out and submitted the contact form on acme-corp.com with your saved profile information. You should receive a confirmation email shortly.

๐Ÿ‘ค

You

Scrape all product names and prices from this category page: https://example.com/products

๐Ÿฆž

Moltbot

๐Ÿ“Š Data extraction complete! Found 24 products:

ProductPrice
Premium Widget$49.99
Super Gadget$129.99
Deluxe Package$299.99
... and 21 more

๐Ÿ’พ Saved to: ~/Downloads/product-data.json

Setup Guide

1. Install Puppeteer/Playwright

# Install browser automation tools
npm install -g puppeteer
# OR
npm install -g playwright

# For Moltbot browser skill
npm install @moltbot/browser-automation

2. Basic Browser Skill

// skills/browser-automation.js
const puppeteer = require('puppeteer');

module.exports = {
  name: 'browser-automation',
  
  async run({ command, config, apis }) {
    const browser = await puppeteer.launch({
      headless: true,
      args: ['--no-sandbox', '--disable-setuid-sandbox']
    });
    
    try {
      const page = await browser.newPage();
      
      // Set viewport
      await page.setViewport({ width: 1920, height: 1080 });
      
      // Execute the requested action
      switch (command.action) {
        case 'scrape':
          return await scrapeData(page, command.url, command.selector);
        case 'fillForm':
          return await fillForm(page, command.url, command.data);
        case 'screenshot':
          return await takeScreenshot(page, command.url);
        case 'monitorPrice':
          return await monitorPrice(page, command.url, command.selector);
      }
    } finally {
      await browser.close();
    }
  }
};

async function scrapeData(page, url, selector) {
  await page.goto(url, { waitUntil: 'networkidle2' });
  
  const data = await page.evaluate((sel) => {
    const elements = document.querySelectorAll(sel);
    return Array.from(elements).map(el => ({
      text: el.innerText,
      href: el.href
    }));
  }, selector);
  
  return { scraped: data.length, data };
}

async function fillForm(page, url, formData) {
  await page.goto(url, { waitUntil: 'networkidle2' });
  
  for (const [field, value] of Object.entries(formData)) {
    await page.type(`[name="${field}"]`, value);
  }
  
  await page.click('button[type="submit"]');
  await page.waitForNavigation();
  
  return { success: true, url: page.url() };
}

3. Price Monitoring Skill

// skills/price-monitor.js
module.exports = {
  name: 'price-monitor',
  schedule: '0 */6 * * *', // Every 6 hours
  
  async run({ config, apis }) {
    const products = await apis.db.getMonitoredProducts();
    
    for (const product of products) {
      const currentPrice = await scrapePrice(product.url, product.selector);
      
      if (currentPrice < product.targetPrice) {
        await apis.notify.sendWhatsApp({
          message: `๐Ÿšจ Price Drop Alert!
          
๐Ÿ“ฆ ${product.name}
๐Ÿ’ฐ Now: $${currentPrice} (was $${product.lastPrice})
๐ŸŽฏ Target: $${product.targetPrice}
๐Ÿ”— ${product.url}`
        });
      }
      
      await apis.db.updatePrice(product.id, currentPrice);
    }
  }
};

async function scrapePrice(url, selector) {
  // Implementation using browser skill
  const result = await apis.skills.run('browser-automation', {
    action: 'scrape',
    url,
    selector
  });
  
  return parseFloat(result.data[0].text.replace(/[^0-9.]/g, ''));
}

4. Configuration

// ~/.moltbot/moltbot.json
{
  "browser": {
    "enabled": true,
    "provider": "puppeteer",
    "headless": true,
    "slowMo": 0,
    "viewport": {
      "width": 1920,
      "height": 1080
    },
    "userDataDir": "~/.moltbot/browser-data",
    "profiles": {
      "default": {
        "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"
      },
      "mobile": {
        "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0)",
        "viewport": { "width": 390, "height": 844 }
      }
    }
  }
}

Best Practices & Ethics

Respect robots.txt

Always check and respect website crawling policies. Don't scrape sites that prohibit it.

Rate Limiting

Add delays between requests. Don't hammer servers with rapid-fire automation.

Error Handling

Websites change. Build robust selectors and handle failures gracefully with screenshots.

Data Storage

Cache scraped data appropriately. Don't store personal data without consent.

Popular Automation Recipes

๐Ÿ  Apartment Hunting

Auto-scrape apartment listings, filter by criteria, and alert when new places matching your requirements are posted.

"Check Apartments.com for 2BR under $3000 in Brooklyn, alert me when new listings appear"

โœˆ๏ธ Flight Deal Finder

Monitor flight prices on Google Flights, track price history, and buy when prices drop below threshold.

"Track NYC to Tokyo flights for March, buy if under $800 roundtrip"

๐Ÿ“Š Competitor Monitoring

Track competitor pricing, product launches, and website changes automatically.

"Weekly screenshot of competitor pricing pages, highlight any changes"

๐Ÿ“ฐ News Aggregation

Scrape multiple news sources, use AI to summarize, and deliver a personalized daily digest.

"Summarize tech news from HN, TechCrunch, and Ars every morning at 8am"

Tools & Libraries

Puppeteer

Google's Node.js library for controlling Chrome. Great for scraping and automation.

pptr.dev

Playwright

Microsoft's automation library. Supports multiple browsers, better for testing.

playwright.dev

Cheerio

Lightweight jQuery-like library for server-side HTML parsing. Fast for simple scraping.

cheerio.js.org

Automate the Web

Stop doing repetitive web tasks manually. Let Moltbot handle the browsing while you focus on what matters.