clean-content-fetch
Scrapling Web Fetch
当用户要获取网页内容、正文提取、把网页转成 markdown/text、抓取文章主体时,优先使用此技能。
默认流程
- 使用
python3 scripts/scrapling_fetch.py <url> <max_chars> - 默认正文选择器优先级:
articlemain.post-content[class*="body"]
- 命中正文后,使用
html2text转 Markdown - 若都未命中,回退到
body - 最终按
max_chars截断输出
用法
python3 /Users/zzd/.openclaw/workspace/skills/scrapling-web-fetch/scripts/scrapling_fetch.py <url> 30000
依赖
优先检查:
scraplinghtml2textcurl_cffiplaywrightbrowserforge
推荐使用独立虚拟环境,避免系统 Python 的 PEP 668 限制:
python3 -m venv /Users/zzd/.openclaw/workspace/.venvs/clean-content-fetch
/Users/zzd/.openclaw/workspace/.venvs/clean-content-fetch/bin/pip install scrapling html2text curl_cffi playwright browserforge
/Users/zzd/.openclaw/workspace/.venvs/clean-content-fetch/bin/python -m playwright install chromium
如直接运行脚本,优先使用该虚拟环境中的 Python:
/Users/zzd/.openclaw/workspace/.venvs/clean-content-fetch/bin/python /Users/zzd/.openclaw/workspace/skills/scrapling-web-fetch/scripts/scrapling_fetch.py <url> 30000
输出约定
脚本默认输出 Markdown 正文内容。
如需结构化输出,可追加 --json。
如需调试提取命中了哪个 selector,可查看 stderr 输出。
附加资源
- 用法参考:
/Users/zzd/.openclaw/workspace/skills/scrapling-web-fetch/references/usage.md - 选择器策略:
/Users/zzd/.openclaw/workspace/skills/scrapling-web-fetch/references/selectors.md - 统一入口:
/Users/zzd/.openclaw/workspace/skills/scrapling-web-fetch/scripts/fetch-web-content
何时用这个技能
- 获取文章正文
- 抓博客/新闻/公告正文
- 将网页转成 Markdown 供后续总结
- 常规 fetch 效果差,希望提升现代网页抓取稳定性
- 抓小红书分享短链或笔记落地页正文
小红书抓取方法
对于 xhslink.com 短链或小红书笔记页,推荐直接使用虚拟环境中的脚本运行:
/Users/zzd/.openclaw/workspace/.venvs/clean-content-fetch/bin/python /Users/zzd/.openclaw/workspace/skills/scrapling-web-fetch/scripts/scrapling_fetch.py 'http://xhslink.com/o/9745hugimlD' 30000
说明:
- 脚本会先解析短链并抓取落地页正文
- 适合提取小红书笔记文案、标题和主体内容
- 若页面需要更复杂交互,再切到浏览器自动化
何时不用
- 需要完整浏览器交互、点击、登录、翻页时:改用浏览器自动化
- 只是简单获取 API JSON:直接请求 API 更合适
More from leoyeai/openclaw-master-skills
readgzh
ReadGZH — Let AI read full-text WeChat Official Account articles. Supports standard articles and image-post formats.
4tushare-finance
获取中国金融市场数据(A股、港股、美股、基金、期货、债券)。支持220+个Tushare Pro接口:股票行情、财务报表、宏观经济指标。当用户请求股价数据、财务分析、指数行情、GDP/CPI等宏观数据时使用。
3find-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
2eastmoney_financial_data
本 Skill 基于东方财富权威数据库及最新行情底层数据构建,支持通过自然语言查询行情类数据(股票、行业、板块、指数、基金、债券的实时行情、主力资金流向、估值等)、财务类数据(上市公司基本信息、财务指标、高管信息、主营业务等)、关系与经营类数据(关联关系、企业经营数据)。避免模型基于过时知识回答金融数据问题,提供权威及时的金融数据。
2stock-analysis
Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock scoring, viral trend detection (Hot Scanner), and rumor/early signal detection. Use for stock analysis, portfolio tracking, earnings reactions, crypto monitoring, trending stocks, or finding rumors before they hit mainstream.
2linkedin
LinkedIn automation via browser relay or cookies for messaging, profile viewing, and network actions.
1