selenium-browser

Start a Selenium‑controlled Chrome browser, open a URL, take a screenshot, and report progress. Supports headless mode and optional proxy.

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 "selenium-browser" with this command: npx skills add andreybespalov89/selenium-browser

Usage

The skill triggers on any message that contains Chrome, browser, Selenium, screenshot, or open.

selenium-browser <URL> [--headless] [--proxy=<url>]

Command flow

  1. Launch Chrome (or Chromium) under Selenium.
  2. Navigate to <URL>.
  3. Take a screenshot of the loaded page.
  4. Save the image in /home/main/clawd/diffusion_pdfs/ and report the path back to the chat.
  5. If anything fails, send an error message.

Scripts

scripts/launch_browser.py

#!/usr/bin/env python3
import os
import sys
import time
import base64
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options

# CLI parsing
import argparse
parser = argparse.ArgumentParser(description="Launch Selenium Chrome and take a screenshot.")
parser.add_argument("url", help="URL to open")
parser.add_argument("--headless", action="store_true", help="Run Chrome headless")
parser.add_argument("--proxy", help="Proxy URL (e.g., http://proxy:3128)")
args = parser.parse_args()

# Prepare Chrome options
chrome_options = Options()
if args.headless:
    chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
if args.proxy:
    chrome_options.add_argument(f"--proxy-server={args.proxy}")

# Locate binaries
chrome_bin = os.getenv("CHROME_BIN", "/usr/bin/google-chrome")
chromedriver_path = os.getenv("CHROMEDRIVER_PATH", "/usr/local/bin/chromedriver")

service = Service(executable_path=chromedriver_path)

# Start browser
try:
    driver = webdriver.Chrome(service=service, options=chrome_options)
except Exception as e:
    print(f"❌ Failed to start Chrome: {e}", file=sys.stderr)
    sys.exit(1)

# Navigate and wait for page load
try:
    driver.get(args.url)
    time.sleep(5)  # simple wait; can replace with WebDriverWait for better reliability
except Exception as e:
    print(f"❌ Navigation error: {e}", file=sys.stderr)
    driver.quit()
    sys.exit(1)

# Take screenshot
screenshot_path = os.path.join(os.getenv("HOME", "/tmp"), "screenshot.png")
try:
    driver.save_screenshot(screenshot_path)
except Exception as e:
    print(f"❌ Screenshot error: {e}", file=sys.stderr)
    driver.quit()
    sys.exit(1)

# Clean up
driver.quit()

# Output a JSON object that OpenClaw can parse for the reply
print({"status": "ok", "screenshot": screenshot_path})

scripts/_env.sh

# Optional: set paths to Chrome/Chromedriver if not in standard locations
# export CHROME_BIN="/opt/google/chrome/google-chrome"
# export CHROMEDRIVER_PATH="/usr/local/bin/chromedriver"

References

How the skill reports

The skill runs the Python script and captures its stdout as a JSON payload. OpenClaw parses the JSON and sends a message back:

✅ Screenshot saved: /home/main/clawd/diffusion_pdfs/screenshot.png

If the script prints an error, the skill forwards the error text.


Installation notes

  1. Make sure chromedriver is in /usr/local/bin/chromedriver or set CHROMEDRIVER_PATH.
  2. Make sure google-chrome (or chromium) is in /usr/bin/google-chrome or set CHROME_BIN.
  3. Install Python dependencies: pip install selenium (inside the virtual env you use for the skill).
pip install selenium

Logging & timeouts

The script uses a 5‑second static wait after navigation; replace with Selenium's WebDriverWait for dynamic waits.

If you encounter timeouts, adjust the time.sleep(5) value or use WebDriverWait(driver, 20).until(...).


Feel free to tweak the script to fit your environment (proxy, authentication, etc.).

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

Charging Ledger

充电记录账本 - 从截图提取充电信息并记录,支持按周、月查询汇总。**快速暗号**: 充电记录、充电账本、充电汇总。**自然触发**: 记录充电、查询充电费用、充电统计。

Registry SourceRecently Updated
General

qg-skill-sync

从团队 Git 仓库同步最新技能到本机 OpenClaw。支持首次设置、定时自动更新、手动同步和卸载。当用户需要同步技能、设置技能同步、安装或更新团队技能,或提到「技能同步」「同步技能」时使用。

Registry SourceRecently Updated
General

Ad Manager

广告投放管理 - 自动管理广告投放、优化ROI、生成报告。适合:营销人员、电商运营。

Registry SourceRecently Updated