Web Scraper

guia-matthieu/clawfu-skills/skills/automation/web-scraper

作者 guia-matthieu4108f5c010ccaa8b5707fa05ca1d888ae167e548MIT收錄於 2026年10月9日更新於 2026年10月9日

Extract structured data from websites. Use when: collecting competitor pricing; scraping product listings; extracting contact information; gathering research data; monitoring website changes

包含腳本Data & Analytics
AI 產生的概覽

使用 Python 擷取指令碼從網站擷取結構化資料、連結、電子郵件和頁面元素。

功能
提供命令列 Python 指令碼,可抓取網頁並透過 CSS 選擇器擷取內容、收集連結、蒐集電子郵件地址,以及擷取文章或產品等結構化欄位。結果可列印輸出或寫入 JSON 等檔案。文件也說明 CSS 選擇器語法和合乎道德的擷取做法。
適用情境
適用於收集競品價格、產品清單、聯絡資訊、研究資料,或監控網頁變更。
執行需求
需要 Python 環境並安裝 beautifulsoup4、requests、pandas、click 和 lxml;需要連線至目標網站的網路存取。附有可執行指令碼(scripts/main.py、scripts/requirements.txt)。

Web Scraper

Extract structured data from websites using BeautifulSoup and requests - turn any webpage into usable data.

When to Use This Skill

  • Competitor research - Scrape pricing, features, positioning
  • Lead generation - Extract contact info from directories
  • Content audit - Pull headings, links, meta data
  • Price monitoring - Track competitor pricing changes
  • Data collection - Gather research data from multiple sources

What Claude Does vs What You Decide

Claude DoesYou Decide
Structures analysis frameworksStrategic priorities
Synthesizes market dataCompetitive positioning
Identifies opportunitiesResource allocation
Creates strategic optionsFinal strategy selection
Suggests implementation approachesExecution decisions

Dependencies

bash
pip install beautifulsoup4 requests pandas click lxml

Commands

Scrape Elements

bash
python scripts/main.py scrape https://example.com --selector "h1,h2,p"python scripts/main.py scrape https://example.com --selector ".product-price"

Extract Links

bash
python scripts/main.py links https://example.compython scripts/main.py links https://example.com --internal-only

Extract Emails

bash
python scripts/main.py emails https://example.compython scripts/main.py emails https://example.com --depth 2

Extract Structured Data

bash
python scripts/main.py structured https://example.com/article --schema articlepython scripts/main.py structured https://example.com/product --schema product

Examples

Example 1: Scrape Competitor Pricing

bash
python scripts/main.py scrape https://competitor.com/pricing --selector ".price,.plan-name"
# Output:# Extracted 6 elements# 1. Starter - $29/mo# 2. Pro - $99/mo# 3. Enterprise - Contact us

Example 2: Extract Article Content

bash
python scripts/main.py structured https://blog.example.com/post --schema article
# Output: article_data.json# {#   "title": "How to Scale Your Startup",#   "author": "Jane Doe",#   "date": "2024-01-15",#   "content": "...",#   "word_count": 1523# }

CSS Selector Reference

SelectorDescriptionExample
tagElement typeh1, p, div
.classClass name.price, .title
#idElement ID#main-content
tag.classTag with classdiv.product
tag[attr]Has attributea[href]
parent > childDirect childul > li
tag1, tag2Multipleh1, h2, h3

Ethical Scraping Guidelines

  1. Check robots.txt - Respect site's scraping policy
  2. Rate limit - Don't overload servers (1-2 req/sec)
  3. Identify yourself - Use descriptive User-Agent
  4. Cache requests - Don't re-scrape unchanged pages
  5. Terms of Service - Check if scraping is allowed

Skill Boundaries

What This Skill Does Well

  • Structuring strategic analysis
  • Identifying market opportunities
  • Creating strategic frameworks
  • Synthesizing competitive data

What This Skill Cannot Do

  • Replace market research
  • Guarantee strategic success
  • Know proprietary competitor info
  • Make executive decisions

Related Skills

  • competitor-monitor - Monitor competitor changes
  • pdf-extractor - Extract from PDFs

Skill Metadata

  • Mode: centaur
yaml
category: automationsubcategory: data-extractiondependencies: [beautifulsoup4, requests, pandas]difficulty: intermediatetime_saved: 5+ hours/week

來源與署名

來源:guia-matthieu/clawfu-skills位於skills/automation/web-scraper提交4108f5c

授權條款: MIT

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架