chrome-automation

Linux服务器Chrome浏览器自动化方案。支持2K高清截图、表单填写、自动登录、绕过反爬虫检测。适用于B站、YouTube等网站自动化操作。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "chrome-automation" with this command: npx skills add chrome-automation

Chrome 浏览器自动化

服务器环境下的Chrome浏览器自动化方案,支持2K高清截图和复杂交互操作。

🚀 快速开始

方案1:Chrome 无头模式(简单截图)

# 2K高清截图(推荐默认)
google-chrome --headless=new --no-sandbox --disable-gpu \
  --window-size=1920,1080 --force-device-scale-factor=2 \
  --screenshot=/home/Kano/.openclaw/workspace/screenshot.png \
  https://www.bilibili.com

参数说明:

参数作用
--headless=new新版无头模式
--window-size=1920,1080窗口分辨率
--force-device-scale-factor=22倍缩放(2K清晰度)
--no-sandbox跳过沙箱(服务器必需)
--disable-gpu禁用GPU(服务器必需)

方案2:Playwright + Stealth(高级自动化)

适用于: 填表、登录、发帖、绕过反爬虫检测

# Stealth模式截图
python3 ~/.openclaw/workspace/skills/chrome-automation/scripts/playwright_stealth.py <URL>

# 指定输出路径
python3 ~/.openclaw/workspace/skills/chrome-automation/scripts/playwright_stealth.py <URL> -o <输出路径>

Python调用:

import sys
sys.path.insert(0, '/home/Kano/.playwright-env/lib/python3.11/site-packages')
sys.path.insert(0, '/home/Kano/.openclaw/workspace/skills/chrome-automation/scripts')

from playwright_stealth import screenshot_with_stealth, auto_fill_form

# 截图(自动绕过反爬虫)
screenshot_with_stealth('https://bilibili.com')

# 自动填表登录
auto_fill_form('https://login.example.com', {
    '#username': '用户名',
    '#password': '密码'
}, submit_selector='button[type=submit]')

📊 方案对比

特性Chrome无头Playwright
启动速度⚡ 最快🚀 快
截图质量✅ 2K高清✅ 2K高清
绕过反爬虫⚠️ 容易被检测✅ Stealth模式
填表/登录❌ 不支持✅ 完美支持
资源占用
推荐场景简单截图复杂自动化

🔧 常用命令

# ========== 基础截图 ==========
# 默认分辨率
google-chrome --headless=new --no-sandbox --disable-gpu \
  --screenshot=output.png https://example.com

# 2K高清(推荐)
google-chrome --headless=new --no-sandbox --disable-gpu \
  --window-size=1920,1080 --force-device-scale-factor=2 \
  --screenshot=output.png https://example.com

# 全页面截图
google-chrome --headless=new --no-sandbox --disable-gpu \
  --window-size=1920,1080 --hide-scrollbars \
  --screenshot=output.png https://example.com

# ========== Playwright ==========
# Stealth截图
python3 ~/.openclaw/workspace/skills/chrome-automation/scripts/playwright_stealth.py <URL>

# 自定义输出
python3 ~/.openclaw/workspace/skills/chrome-automation/scripts/playwright_stealth.py <URL> -o <路径>

🛠️ 环境信息

组件版本/路径
Google Chrome/usr/bin/google-chrome (v145+)
Playwright~/.playwright-env/ (v1.58.0)
Python虚拟环境~/.playwright-env/
Stealth脚本scripts/playwright_stealth.py

⚠️ 注意事项

  1. 每次运行都是新会话,不会保留登录状态
  2. 截图默认保存到 /home/Kano/.openclaw/workspace/
  3. B站等网站可能触发验证码,需要人工处理或使用已登录的Cookie

🔗 相关文件

  • Stealth脚本:scripts/playwright_stealth.py
  • 测试脚本:scripts/test_playwright.py

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Zip

Zip - command-line tool for everyday use

Registry SourceRecently Updated
General

Youtube Script

YouTube视频脚本、标题A/B测试、缩略图文案、SEO优化、开头Hook、章节标记。YouTube script writer with title testing, thumbnail copy, SEO optimization, hooks, chapter markers. Use when you...

Registry SourceRecently Updated
1760ckchzh
General

Topmediai AI Music Generator

Generate AI music, BGM, or lyrics via TopMediai API. Supports auto polling and two-stage output (preview first, then final full audio) for generation tasks.

Registry SourceRecently Updated
General

Yamlcheck

YAML validator and formatter. Validate YAML syntax, pretty-print with proper indentation, convert between YAML and JSON, and lint YAML files for common issues.

Registry SourceRecently Updated