🎁 Get the FREE AI Skills Starter GuideSubscribe →
BytesAgainBytesAgain
🦀 ClawHub

Scrape Web

by @jnmhub

使用 Python + Scrapling 获取网页内容,支持简单选择器

Versionv1.0.0
Downloads4,326
Stars1
TERMINAL
clawhub install scrape-web

📖 About This Skill


name: scrape-web description: "使用 Python + Scrapling 获取网页内容,支持简单选择器" version: "1.1.0" tags: - python - scrape - web requires: tools: ["exec"] env: ["python"]

Scrape Web Skill

使用 Scrapling 获取网页内容,返回纯文本或选择器结果。

安装依赖

pip install "scrapling[all]"
scrapling install
pip install httpx

用法

1) 直接抓取纯文本

python scripts/scrape_web.py --url "https://example.com"

2) 使用 CSS 选择器

python scripts/scrape_web.py --url "https://example.com" --selector "title::text"

3) 保存到文件

python scripts/scrape_web.py --url "https://example.com" --out "output.txt"