browser-auto-download
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.
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
| System | Architecture | Auto-Detection |
|---|---|---|
| Windows | AMD64/x86_64 | ✅ windows, win64, x64, 64-bit |
| Windows | x86/i686 | ✅ windows, win32, x86, 32-bit |
| macOS | ARM64 (M1/M2/M3) | ✅ macos, arm64, apple silicon |
| macOS | x86_64 (Intel) | ✅ macos, x64, intel |
| Linux | x86_64 | ✅ linux, x64, amd64 |
📦 Installation
Requirements
pip install playwright
playwright install chromium
Install Skill
- Download
browser-auto-download.skillfrom ClawHub - Place in your OpenClaw skills directory
- 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)
| Website | Result | Mode | File Size |
|---|---|---|---|
| Meitu Xiuxiu | ✅ Success | Auto-download + Navigation | 13.0 MB |
| WeChat DevTools | ✅ Success | Precise button click | 231.9 MB |
| Python.org | ✅ Success | Direct exe link | 28.8 MB |
| 7-Zip | ✅ Success | Relative path link | 1.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
| Pattern | Example | Supported |
|---|---|---|
| Auto-download on load | Meitu Xiuxiu | ✅ |
| Direct .exe link | Python.org | ✅ |
| Relative path (a/file.exe) | 7-Zip | ✅ |
| Multi-step navigation | Homepage → 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
- Playwright - Browser automation framework
- OpenClaw - AI agent platform
- ClawHub - Skill sharing platform
📮 Contact
- Issues: https://github.com/your-repo/browser-auto-download/issues
- Discord: https://discord.gg/clawd
- ClawHub: https://clawhub.com/skills/browser-auto-download
Made with ❤️ for OpenClaw
Automate the boring stuff. Download with intelligence.