openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > Selenium Browser

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

通信与消息

作者:Andrei Bespalov @andreybespalov89

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v1.0.0

统计:⭐ 0 · 409 · 7 current installs · 7 all-time installs

0

安装量(当前) 7

🛡 VirusTotal :可疑 · OpenClaw :可疑

Package:andreybespalov89/selenium-browser

安全扫描(ClawHub)

  • VirusTotal :可疑
  • OpenClaw :可疑

OpenClaw 评估

The skill's stated behavior (take a screenshot and report a JSON result) does not match the provided script files and instructions—there are conflicting scripts, output-format mismatches, and a potentially indefinite-running process, so verify before installing.

目的

The declared purpose (launch Chrome via Selenium, capture a screenshot, return the saved path) is reasonable. However the SKILL.md and the actual scripts disagree: SKILL.md includes a script that saves a screenshot and prints a JSON-like dict, but the file manifest's launch_browser.py opens the page and then loops forever without taking or saving a screenshot. SKILL.md also promises saving to /home/main/clawd/diffusion_pdfs/, which is not used…

说明范围

SKILL.md instructs the agent to run the Python script and parse stdout as JSON. The embedded script in SKILL.md prints a Python dict (not serialized JSON) and the actual file on disk does not print or return the expected JSON and instead blocks in an infinite loop. The mismatch could cause the agent to hang, mis-parse output, or never receive a screenshot path. The instructions also reference a fixed save path in SKILL.md that is not present i…

安装机制

There is no automated install spec—this is instruction-only with bundled scripts and a recommendation to pip install selenium. No remote downloads or archive extractions are present in the package itself, so install risk is low, assuming the operator runs the recommended pip command from a trusted environment.

证书

The skill requests no credentials and only optionally uses CHROME_BIN and CHROMEDRIVER_PATH env vars (reasonable). It supports an optional proxy. However SKILL.md's hardcoded save path (/home/main/clawd/diffusion_pdfs/) is unexpected and unrelated to the skill's basic function; the bundled scripts do not reliably respect or expose a configurable, safe output path. That fixed-path claim is disproportionate and should be clarified or removed.

持久

The registry flags are normal (not always:true). But the bundled script in the manifest enters an indefinite while-true sleep loop, relying on an external KeyboardInterrupt or 'terminate' to exit; that behavior can leave the agent waiting and consume resources. This persistence is not expressed in SKILL.md and should be addressed (timeouts or explicit termination protocol).

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Selenium Browser」。简介:Start a Selenium‑controlled Chrome browser, open a URL, take a screenshot, and …。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/andreybespalov89/selenium-browser/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: selenium-browser
description: "Start a Selenium‑controlled Chrome browser, open a URL, take a screenshot, and report progress.  Supports headless mode and optional proxy."
---

## Usage

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

```bash
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

```python
#!/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

```bash
# 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

- [Selenium docs](https://www.selenium.dev/documentation/)
- [ChromeDriver download page](https://chromedriver.chromium.org/downloads)

## 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).

```bash
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.).
```