返回顶部
s

selenium-automationSelenium浏览器自动化

Browser automation skill using Selenium for web scraping, form filling, and UI testing. Use when Codex needs to automate browser interactions including: (1) Filling forms and submitting data, (2) Web scraping and data extraction, (3) UI testing and validation, (4) Clicking buttons and navigating pages, (5) Handling alerts and popups, (6) Taking screenshots of web pages

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
149
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

selenium-automation

Selenium 浏览器自动化技能

本技能提供基于Selenium WebDriver的全面浏览器自动化能力。

快速开始

基础表单填写示例:
python

填写并提交表单


python scripts/form_filler.py --url https://example.com/login --username testuser --password testpass

网页抓取示例:
python

从网页提取数据


python scripts/web_scraper.py --url https://example.com/data --output results.csv

安装要求

使用本技能前,请安装所需依赖:
bash
pip install selenium webdriver-manager beautifulsoup4 pandas

支持的浏览器

  • - Chrome:通过ChromeDriver提供完整支持
  • Firefox:通过GeckoDriver提供完整支持
  • Edge:通过EdgeDriver提供完整支持
  • Safari:有限支持(仅限macOS)

核心脚本

表单填写(scripts/form_filler.py)

自动填写表单并提交数据: python python scripts/form_filler.py --url https://example.com/login --username testuser --password testpass python scripts/form_filler.py --url https://example.com/contact --name 张三 --email john@example.com --message 你好

网页抓取器(scripts/web_scraper.py)

从网页提取数据: python python scripts/web_scraper.py --url https://example.com/products --output products.csv python scripts/web_scraper.py --url https://example.com/news --output news.json --format json

UI测试器(scripts/ui_tester.py)

执行UI测试与验证: python python scripts/ui_tester.py --url https://example.com --element login-button --action click python scripts/ui_tester.py --url https://example.com --element username --action type --text testuser

使用示例

详见examples/目录中的综合示例,包括:

  • - 多种输入类型的表单填写
  • 带分页功能的网页抓取
  • UI测试工作流程
  • 错误处理与重试机制
  • 浏览器配置选项

浏览器配置

脚本支持多种浏览器配置:

  • - 无头模式用于后台自动化
  • 不同视口尺寸
  • 自定义用户代理
  • 代理支持
  • 下载目录配置

错误处理

全面的错误处理机制:

  • - 元素未找到
  • 页面加载超时
  • 网络问题
  • 浏览器崩溃
  • 表单验证错误

高级功能

  • - 等待策略:显式等待、隐式等待、流畅等待
  • 元素定位器:ID、CSS选择器、XPath、名称、类名
  • JavaScript执行:在浏览器中运行自定义JavaScript
  • 文件上传:处理文件输入字段
  • Cookie管理:获取、设置和管理Cookie
  • 截图功能:捕获全页面或元素截图

与其他技能的集成

本技能可与以下技能结合使用:

  • - browser-opener:以编程方式打开浏览器
  • data-processing:处理抓取的数据
  • file-operations:保存和管理输出文件

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 selenium-automation-skill-1776123437 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 selenium-automation-skill-1776123437 技能

通过命令行安装

skillhub install selenium-automation-skill-1776123437

下载

⬇ 下载 selenium-automation v1.0.0(免费)

文件大小: 11.74 KB | 发布时间: 2026-4-14 14:04

v1.0.0 最新 2026-4-14 14:04
Initial release of selenium-automation skill

- Provides browser automation using Selenium for web scraping, form filling, UI testing, navigation, alert handling, and screenshot capture.
- Includes ready-to-use scripts for form filling, web scraping, and UI testing.
- Supports Chrome, Firefox, Edge (full), and Safari (limited) browsers.
- Features customizable browser configuration (e.g., headless mode, proxies), comprehensive error handling, and advanced automation features.
- Integration guidance for use with data-processing and file-operations skills.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部