360 Secure SkillHub
360 安全技能中心

Playwright Commander

提供基于 Python 脚本的命令行接口,调用 Playwright 启动浏览器、导航到 URL、截图、获取 HTML 或文本、执行 JavaScript,并与页面元素点击、输入、填表交互,用于网页 UI 自动化、内容分析与调试。

RuneweaverStudios
RuneweaverStudios
热度 77.58
最近更新 2026-05-20 03:38:59
分类:自动化依赖:代码执行 / 联网浏览搜索 / 读写文件应用场景:自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add playwright-commander
Metadata
name
playwright-commander
displayName
Playwright Commander
description
A skill to interact with web browsers using Playwright for advanced UI automation, analysis, and debugging.
version
0.1.0

Playwright Commander Skill

Description

This skill provides agents with a powerful interface to programmatically control web browsers using Playwright. It enables advanced UI automation, web content analysis, and debugging capabilities beyond what the default browser tool might offer directly.

Core Functionalities

  • Launch and close browser instances.
  • Navigate to specified URLs.
  • Capture screenshots of web pages.
  • Retrieve HTML content or readable text from pages.
  • Execute custom JavaScript within the browser context.
  • Interact with web elements (click, type, fill forms) using various selectors.
  • Retrieve element attributes or text content.

Usage

This skill is designed for programmatic interaction via exec commands, typically orchestrated by an agent.

# Example: Launch browser and navigate
python3 scripts/playwright_cli.py launch_browser --browser chrome --headless true

# Example: Navigate to URL and take screenshot
python3 scripts/playwright_cli.py navigate --url "https://example.com" --screenshot "path/to/screenshot.png"

# Example: Get page content
python3 scripts/playwright_cli.py get_content --url "https://example.com" --type html

# Example: Click an element
python3 scripts/playwright_cli.py click_element --url "https://example.com" --selector "button.submit"

Prerequisites

  • Playwright Python package (playwright) installed in the skill's virtual environment.
  • Playwright browser binaries installed (playwright install).

Configuration (config.json)

(To be defined if specific configuration beyond default Playwright options is needed.)

Purpose

To give me more granular and robust control over web browser interactions, enabling more complex UI automation, detailed web page analysis, and better troubleshooting capabilities for browser-related issues, especially for the Mac App conversion project.