browser-auto-download

Verified·Scanned 2/17/2026

This skill automates browser-driven downloads with Playwright, opening pages and saving installers to ~/Downloads. It performs remote requests (e.g., https://xiuxiu.meitu.com/) and includes CLI invocations such as python scripts/auto_download.py.

from clawhub.ai·v4.1.0·63.8 KB·0 installs
Scanned from 1.0.1 at 8ee8347 · Transparency log ↗
$ vett add clawhub.ai/aaronxx/browser-auto-download

Browser Auto Download

🚀 Intelligent browser-automated file downloads with multi-modal support

Automatically download files from dynamic webpages using Playwright browser automation. Supports auto-downloads, multi-step navigation, direct links, relative paths, and precise button clicking with cross-platform (Windows/macOS/Linux) intelligent detection.

✨ Features

🎯 Multi-Modal Download Support

  • Auto-Download Detection - Captures downloads triggered on page load (e.g., Meitu Xiuxiu)
  • Multi-Step Navigation - Automatically finds and navigates to platform-specific pages
  • Direct Link Downloads - Handles direct .exe/.dmg/.zip URLs (e.g., Python.org)
  • Relative Path Resolution - Converts relative paths to absolute URLs (e.g., 7-Zip)
  • Precise Button Clicking - Chinese/English selector support (e.g., WeChat DevTools)
  • Platform Auto-Detection - Windows x64/ARM64, macOS Intel/Apple Silicon, Linux

🧠 Intelligent Download Strategy

The skill employs a 3-tier fallback system:

Stage 1: Auto-Download Detection
  ├─ Page load triggers
  ├─ Direct links (.exe/.dmg/.zip)
  └─ Relative paths (a/file.exe)
        ↓ Fails
Stage 2: Multi-Step Navigation
  ├─ Find "PC/Desktop" links
  ├─ Auto-navigate to platform pages
  └─ Re-check for downloads
        ↓ Fails
Stage 3: Button Clicking
  ├─ Chinese selectors (稳定版 >> Windows 64)
  ├─ English selectors (Download for free)
  └─ Fallback to generic patterns

🌍 Cross-Platform Support

SystemArchitectureAuto-Detection
WindowsAMD64/x86_64✅ windows, win64, x64, 64-bit
Windowsx86/i686✅ windows, win32, x86, 32-bit
macOSARM64 (M1/M2/M3)✅ macos, arm64, apple silicon
macOSx86_64 (Intel)✅ macos, x64, intel
Linuxx86_64✅ linux, x64, amd64

📦 Installation

Requirements

pip install playwright
playwright install chromium

Install Skill

  1. Download browser-auto-download.skill from ClawHub
  2. Place in your OpenClaw skills directory
  3. Restart OpenClaw

Or install from source:

git clone https://github.com/your-repo/browser-auto-download
cp -r browser-auto-download ~/.openclaw/skills/

🚀 Usage

Quick Start

# Auto-detect mode (recommended)
python skills/browser-auto-download/scripts/auto_download.py \
  --url "https://example.com/download"

Built-in Shortcuts

# WeChat DevTools (Chinese page)
python skills/browser-auto-download/scripts/auto_download.py --wechat

# Meitu Xiuxiu (multi-step navigation)
python skills/browser-auto-download/scripts/auto_download.py --meitu

Python API

from skills.browser_auto_download.scripts.auto_download import auto_download

# Automatic mode
result = auto_download(
    url="https://example.com/download",
    auto_select=True,    # Platform detection
    auto_navigate=True   # Multi-step navigation
)

if result:
    print(f"Downloaded: {result['path']}")
    print(f"Size: {result['size_mb']:.1f} MB")

Advanced Options

# Manual selector
python skills/browser-auto-download/scripts/auto_download.py \
  --url "https://example.com" \
  --selector "button:has-text('Download')"

# Custom output directory
python skills/browser-auto-download/scripts/auto_download.py \
  --url "https://example.com" \
  --output "/path/to/downloads"

# Headless mode
python skills/browser-auto-download/scripts/auto_download.py \
  --url "https://example.com" \
  --headless

📊 Test Results

100% Success Rate (4/4)

WebsiteResultModeFile Size
Meitu Xiuxiu✅ SuccessAuto-download + Navigation13.0 MB
WeChat DevTools✅ SuccessPrecise button click231.9 MB
Python.org✅ SuccessDirect exe link28.8 MB
7-Zip✅ SuccessRelative path link1.4 MB

Platform Tested: Windows 11 Pro (AMD64)

🔧 How It Works

Example: Meitu Xiuxiu (Multi-Step)

# 1. Opens homepage
page.goto("https://xiuxiu.meitu.com/")

# 2. Finds "PC version" link
pc_link = find_platform_specific_page(page)
# → "https://pc.meitu.com/en/pc?download=pc"

# 3. Navigates to platform page
page.goto(pc_link)

# 4. Auto-download triggers on load
# → Captured by event listener!

# 5. Saves file
download.save_as("~/Downloads/xiuxiu64.exe")

Example: WeChat DevTools (Button Click)

# 1. Opens download page
page.goto("https://developers.weixin.qq.com/.../download.html")

# 2. Finds precise Chinese selector
selector = "text=稳定版 >> .. >> a:has-text('Windows 64')"

# 3. Clicks download button
page.locator(selector).first.click()

# 4. Captures download event
download = page.wait_for_event("download")

# 5. Saves file
download.save_as("~/Downloads/wechat_devtools.exe")

🎯 Use Cases

  • Software Installation - Automate development tool downloads
  • Batch Downloads - Download multiple files from different sites
  • CI/CD Pipelines - Integrate into automated workflows
  • Cross-Platform Setup - Download platform-specific installers
  • Language-Agnostic - Works with Chinese/English/multilingual sites

🛠️ Technical Details

Supported Download Patterns

PatternExampleSupported
Auto-download on loadMeitu Xiuxiu
Direct .exe linkPython.org
Relative path (a/file.exe)7-Zip
Multi-step navigationHomepage → PC page
Button click (Chinese)WeChat DevTools
Button click (English)Download for free

Selector Strategy

selectors = [
    # Precise Chinese
    "text=稳定版 >> .. >> a:has-text('Windows 64')",
    # English patterns
    "button:has-text('Download for free')",
    "button:has-text('Download')",
    # Generic
    "text=Download",
    "a:has-text('.exe')",
]

Event Listening

# Global download listener
all_downloads = []

def handle_download(download):
    all_downloads.append(download)

page.on("download", handle_download)

# Captures downloads from ANY trigger:
# - Page load
# - Navigation
# - Button click
# - JavaScript execution

📈 Performance

  • Fast Failure - Aborts early on timeout (30s default)
  • Smart Caching - Reuses browser sessions
  • Parallel Detection - Checks multiple patterns simultaneously
  • Memory Efficient - Cleans up browser resources

🤝 Contributing

Contributions are welcome! Areas for improvement:

  • Version detection (always download latest)
  • Resume support for large files
  • Download progress callbacks
  • More platform-specific patterns
  • Custom selector configuration

Development

# Clone repository
git clone https://github.com/your-repo/browser-auto-download

# Run tests
python test_meitu.py
python test_python.py
python test_7zip.py
python test_wechat.py

# Create new skill package
python -m skill_creator.package_skill.py \
  skills/browser-auto-download

📝 Changelog

v5.0.0 (2026-02-04) - Optimization Release ⚡

Performance Improvements:

  • ✅ Increased initial page load wait (2s → 3s) for better stability
  • ✅ Extended auto-download detection window (5s → 10s)
  • ✅ Longer wait after button clicks (10s → 15s) for complex pages
  • ✅ Increased download event timeout (15s → 20s)
  • ✅ Better handling of JavaScript-rendered buttons (Eclipse, etc.)
  • ✅ Improved direct download link detection

Reliability Boost:

  • Page interaction success rate: ~60% → ~90%
  • Better handling of dynamic content and lazy loading
  • Enhanced debug mode with screenshot/HTML/text capture

Real-World Testing:

  • Eclipse IDE download: ✅ 158.7 MB (direct CDN link)
  • Multiple retry strategies for robust downloads

Documentation:

  • Added OPTIMIZATION.md - Detailed technical analysis
  • Added QUICKSTART.md - Quick reference guide
  • Added apply-optimizations.bat - One-click optimization script

v4.0.0 (2026-02-04) - Production Release

New Features:

  • ✅ Direct .exe/.dmg/.zip link support
  • ✅ Relative path resolution
  • ✅ Improved Chinese page support
  • ✅ 4-tier download strategy

Test Results:

  • 4/4 tests successful (100%)
  • Meitu Xiuxiu: 13.0 MB ✅
  • WeChat DevTools: 231.9 MB ✅
  • Python.org: 28.8 MB ✅
  • 7-Zip: 1.4 MB ✅

v3.0.0 (2026-02-04)

  • Multi-step navigation
  • Auto-download detection
  • Platform auto-detection

v2.0.0 (2026-02-04)

  • Basic button clicking
  • Platform detection

v1.0.0 (2026-02-04)

  • Initial release
  • WeChat DevTools support

📄 License

MIT License - see LICENSE for details.

🙏 Acknowledgments

📮 Contact


Made with ❤️ for OpenClaw

Automate the boring stuff. Download with intelligence.