360 Secure SkillHub
360 安全技能中心

Scrape Web

该 Skill 通过 Python 脚本和 Scrapling 抓取指定 URL 的网页内容,默认返回纯文本,也支持 CSS 选择器提取,并可将结果保存到文本文件。运行需联网,并安装 Scrapling 与 httpx 等依赖。

分类:自动化
jnmhub
jnmhub
热度 54.68
最近更新 2026-05-11 17:32:49

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add jnmhub/scrape-web
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
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"