
Web Scraping Automation
- 590 installs
- 82 repo stars
- Updated August 2, 2026
- aaaaqwq/claude-code-skills
web-scraping-automation is an agent skill that extracts structured data from websites, calls REST and GraphQL APIs, and generates scraping scripts for developers who need reliable data ingestion pipelines.
About
web-scraping-automation is a coding-agent skill for automating website data extraction and API integration, covering site structure analysis, REST and GraphQL calls, crawler script generation, parsing, anti-bot handling, and scheduled data collection. Allowed tools include Bash, Read, Write, Edit, WebFetch, and WebSearch, enabling end-to-end script creation inside the agent session. The skill documents Playwright-based browser automation with mandatory Chrome and Selenium process cleanup after browser tasks, plus patterns for headless Chromium scraping. Developers reach for web-scraping-automation when they need product catalogs scraped, news feeds collected on a schedule, API responses parsed into structured records, or anti-scraping workarounds prototyped quickly. It suits backend and data-integration tasks where repeatable scripts—not manual copy-paste—must land in the repository.
- Analyzes website structure and extracts data using requests, BeautifulSoup, Scrapy, Selenium or Playwright
- Calls and parses REST/GraphQL APIs with automatic JSON handling and error recovery
- Creates production-ready scheduled scraping scripts with data cleaning and storage
- Handles anti-scraping mechanisms and dynamic content with headless browser automation
- Enforces mandatory resource cleanup of Chrome/Selenium processes after every run
Web Scraping Automation by the numbers
- 590 all-time installs (skills.sh)
- Ranked #380 of 2,719 Automation & Workflows skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aaaaqwq/claude-code-skills --skill web-scraping-automationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 590 |
|---|---|
| repo stars | ★ 82 |
| Security audit | 2 / 3 scanners passed |
| Last updated | August 2, 2026 |
| Repository | aaaaqwq/claude-code-skills ↗ |
How do you automate website scraping with Playwright?
Automatically extract structured data from websites, call and parse APIs, and generate reliable scraping scripts.
Who is it for?
Developers building data ingestion pipelines who need Playwright crawlers or REST/GraphQL parsers generated inside the agent.
Skip if: Static site frontend work or projects with no need to fetch or parse external web or API data.
When should I use this skill?
A developer asks to scrape a website, call an API, parse returned data, schedule crawls, or bypass anti-scraping limits.
What you get
Scraping scripts, parsed datasets, API client code, and scheduled crawl workflows.
- scraper script
- parsed dataset
- api client code
Files
网站爬取与 API 自动化
功能说明
此技能专门用于自动化网站数据爬取和 API 接口调用,包括:
- 分析和爬取网站结构
- 调用和测试 REST/GraphQL API
- 创建自动化爬虫脚本
- 数据解析和清洗
- 处理反爬虫机制
- 定时任务和数据存储
使用场景
- "爬取这个网站的产品信息"
- "帮我调用这个 API 并解析返回数据"
- "创建一个脚本定时抓取新闻"
- "分析这个网站的 API 接口文档"
- "绕过这个网站的反爬虫限制"
技术栈
⚠️ 资源清理原则(强制)
所有涉及浏览器的爬取任务完成后,必须自动关闭 Chrome/Selenium 进程!
# Playwright 示例
from playwright.sync_api import sync_playwright
def scrape_website():
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
# ... 爬取逻辑 ...
browser.close()
# ⚠️ 强制清理残留进程
import subprocess
subprocess.run(['pkill', '-f', 'chrome'], capture_output=True)
# Selenium 示例
from selenium import webdriver
driver = webdriver.Chrome()
try:
# ... 爬取逻辑 ...
pass
finally:
driver.quit()
# ⚠️ 确保清理
import subprocess
subprocess.run(['pkill', '-f', 'chrome'], capture_output=True)原因: 避免内存泄漏和资源占用,防止 Gateway CPU 100% 过载
Python 爬虫
- requests:HTTP 请求库
- BeautifulSoup4:HTML 解析
- Scrapy:专业爬虫框架
- Selenium:浏览器自动化
- Playwright:现代浏览器自动化
JavaScript 爬虫
- axios:HTTP 客户端
- cheerio:服务端 jQuery
- puppeteer:Chrome 自动化
- node-fetch:Fetch API
工作流程
1. 目标分析:
- 检查网站结构和数据位置
- 分析 API 接口和认证方式
- 评估反爬虫机制
2. 方案设计:
- 选择合适的技术栈
- 设计数据提取策略
- 规划错误处理和重试机制
3. 脚本开发:
- 编写爬虫代码
- 实现数据解析逻辑
- 添加日志和监控
4. 测试优化:
- 验证数据准确性
- 优化性能和稳定性
- 处理边界情况
最佳实践
- 遵守 robots.txt 规则
- 设置合理的请求间隔
- 使用 User-Agent 和请求头
- 实现错误重试机制
- 数据去重和验证
- 使用代理池(如需要)
- 保存原始数据和日志
常见场景示例
1. 简单网页爬取
import requests
from bs4 import BeautifulSoup
def scrape_website(url):
headers = {'User-Agent': 'Mozilla/5.0'}
response = requests.get(url, headers=headers)
soup = BeautifulSoup(response.text, 'html.parser')
# 提取数据
data = []
for item in soup.select('.product'):
data.append({
'title': item.select_one('.title').text,
'price': item.select_one('.price').text
})
return data2. API 调用
import requests
def call_api(endpoint, params=None):
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
response = requests.get(endpoint, headers=headers, params=params)
return response.json()3. 动态网页爬取
from selenium import webdriver
from selenium.webdriver.common.by import By
def scrape_dynamic_page(url):
driver = webdriver.Chrome()
driver.get(url)
# 等待页面加载
driver.implicitly_wait(10)
# 提取数据
elements = driver.find_elements(By.CLASS_NAME, 'item')
data = [elem.text for elem in elements]
driver.quit()
return data反爬虫应对策略
- 请求头伪装:模拟真实浏览器
- 代理轮换:使用代理池
- 验证码处理:OCR 或第三方服务
- Cookie 管理:维护会话状态
- 请求频率控制:避免触发限制
- JavaScript 渲染:使用 Selenium/Playwright
数据存储方案
- CSV/Excel:简单数据导出
- JSON:结构化数据存储
- 数据库:MySQL、PostgreSQL、MongoDB
- 云存储:S3、OSS
- 数据仓库:用于大规模数据分析
Related skills
How it compares
Pick web-scraping-automation over generic scripting skills when the task combines browser crawlers, API parsing, and anti-bot handling in one agent workflow.
FAQ
What browser tools does web-scraping-automation use?
web-scraping-automation documents Playwright with headless Chromium and requires closing Chrome or Selenium processes after browser-based scrape tasks complete.
Can web-scraping-automation work with APIs instead of HTML?
web-scraping-automation covers REST and GraphQL API calls, response parsing, and test workflows alongside traditional website structure analysis and crawler generation.
Is Web Scraping Automation safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.