Skip to content

546715115/browser-automation-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browser Automation Skill

English | 中文

🚀 Overview

A powerful browser automation skill for Claude Code that enables web scraping, data extraction, and content capture with semi-automated login support. Built on Playwright for reliable, cross-browser automation.

✨ Key Features

  • 🔐 Semi-Automated Login - Browser opens visibly, pauses for manual login, then continues automation
  • 🌐 Universal Web Scraping - Extract content from any website (static or dynamic)
  • 📸 Screenshot Capture - Full page or element-specific screenshots
  • 📊 Multiple Output Formats - JSON, Markdown, CSV
  • 🎯 CSS Selector Support - Precise data extraction with custom selectors
  • ⚡ Dynamic Content Handling - Waits for JavaScript-loaded content

📦 Installation

Prerequisites

  • Python 3.7 or higher
  • Claude Code CLI or Desktop App
  • Git (for installation)

Step 1: Install Playwright

```bash pip install playwright playwright install chromium ```

Step 2: Install the Skill

Option A: Install from GitHub

```bash

Clone the repository

git clone https://github.com/YOUR_USERNAME/browser-automation-skill.git

Copy to Claude Code skills directory

cp -r browser-automation-skill ~/.claude/skills/browser-automation ```

Option B: Manual Installation

  1. Download this repository as ZIP
  2. Extract to `~/.claude/skills/browser-automation`
  3. Ensure the directory structure matches: ``` ~/.claude/skills/browser-automation/ ├── SKILL.md ├── scripts/ │ └── scrape.py └── evals/ └── evals.json ```

Step 3: Verify Installation

Restart Claude Code and check if the skill appears:

```bash

The skill should now be available in Claude Code

Try: "Help me scrape content from a website"

```

🎯 Usage

In Claude Code (Recommended)

Simply describe what you want to scrape in natural language:

``` "Scrape the title and first paragraph from Wikipedia's Python page"

"Extract the top 3 trending repositories from GitHub"

"Capture a screenshot of Hacker News homepage and extract the top 5 news items" ```

The skill will automatically trigger when you mention web scraping, content extraction, or browser automation.

Command Line Tool

Use the included `scrape.py` script directly:

```bash

Basic scraping

python ~/.claude/skills/browser-automation/scripts/scrape.py https://example.com

With manual login

python ~/.claude/skills/browser-automation/scripts/scrape.py https://example.com --login

Extract specific fields

python ~/.claude/skills/browser-automation/scripts/scrape.py https://example.com
--selectors title:h1 price:.price-tag description:.product-desc

Save as markdown

python ~/.claude/skills/browser-automation/scripts/scrape.py https://example.com
--format md --output result.md ```

🔐 Semi-Automated Login Workflow

This is the core feature that sets this skill apart:

  1. Browser Opens - Chromium launches in visible mode (not headless)
  2. Navigate to URL - Automatically goes to the target website
  3. ⏸️ Pause for Login - Script pauses with message: "Please log in manually. Press Enter when done."
  4. 👤 You Log In - Complete login in the browser window (handle 2FA, CAPTCHA, etc.)
  5. ▶️ Continue - Press Enter in terminal to resume automation
  6. 📊 Extract Data - Script continues with data extraction
  7. ✅ Complete - Returns structured results

Why Semi-Automated?

  • Handles Complex Auth - Works with 2FA, CAPTCHA, OAuth
  • No Credential Storage - Never stores passwords or tokens
  • Human-in-the-Loop - You maintain control over authentication
  • Reliable - Bypasses anti-bot detection that blocks headless browsers

🛠️ Dependencies

Required

  • Python 3.7+ - Runtime environment
  • Playwright - Browser automation library
  • Chromium - Browser engine (installed via Playwright)

Optional

  • Claude Code - For natural language triggering
  • Git - For easy installation and updates

📄 License

MIT License - see LICENSE file for details

🙏 Acknowledgments


🚀 概述

一个强大的Claude Code浏览器自动化skill,支持网页抓取、数据提取和内容捕获,具有半自动登录支持。基于Playwright构建,可靠的跨浏览器自动化。

✨ 核心特性

  • 🔐 半自动登录 - 浏览器可见打开,暂停等待手动登录,然后继续自动化
  • 🌐 通用网页抓取 - 从任何网站提取内容(静态或动态)
  • 📸 截图捕获 - 整页或特定元素截图
  • 📊 多种输出格式 - JSON、Markdown、CSV
  • 🎯 CSS选择器支持 - 使用自定义选择器精确提取数据
  • ⚡ 动态内容处理 - 等待JavaScript加载的内容

📦 安装

前置要求

  • Python 3.7或更高版本
  • Claude Code CLI或桌面应用
  • Git(用于安装)

步骤1:安装Playwright

```bash pip install playwright playwright install chromium ```

步骤2:安装Skill

方式A:从GitHub安装

```bash

克隆仓库

git clone https://github.com/YOUR_USERNAME/browser-automation-skill.git

复制到Claude Code skills目录

cp -r browser-automation-skill ~/.claude/skills/browser-automation ```

方式B:手动安装

  1. 下载此仓库为ZIP
  2. 解压到 `~/.claude/skills/browser-automation`
  3. 确保目录结构匹配

步骤3:验证安装

重启Claude Code并检查skill是否出现。

🎯 使用方法

在Claude Code中使用(推荐)

用自然语言描述你想抓取的内容:

``` "从Wikipedia的Python页面抓取标题和第一段"

"提取GitHub上前3个热门仓库"

"截图Hacker News首页并提取前5条新闻" ```

🔐 半自动登录工作流程

这是使此skill与众不同的核心功能

  1. 浏览器打开 - Chromium以可见模式启动
  2. 导航到URL - 自动访问目标网站
  3. ⏸️ 暂停登录 - 脚本暂停等待手动登录
  4. 👤 你登录 - 在浏览器窗口中完成登录
  5. ▶️ 继续 - 按Enter恢复自动化
  6. 📊 提取数据 - 脚本继续数据提取
  7. ✅ 完成 - 返回结构化结果

📄 许可证

MIT许可证 - 详见LICENSE文件


⭐ 如果这个skill对你有帮助,请给个Star!

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages