用途:抓取博客文章。默认优先走 RSS/Atom 源,免费且无需 API key;对 JS 渲染较重的站点可用 Apify 回退。
主要能力:自动发现页面的 RSS/Atom 源(检查 HTML link rel="alternate" 标签,并探测 /feed、/rss、/atom.xml、/feed.xml、/rss.xml、/blog/feed、/index.xml 等常见路径);解析 RSS 2.0 与 Atom;支持按日期与关键词过滤(关键词为 OR 逻辑);支持多博客批量抓取;输出 JSON 或 summary。
使用方式:RSS 模式仅需 pip install requests。示例命令: python3 skills/blog-scraper/scripts/scrape_blogs.py --urls "https://example.com/blog" --days 30 多博客加关键词过滤: python3 skills/blog-scraper/scripts/scrape_blogs.py --urls "https://blog1.com,https://blog2.com" --keywords "AI,marketing" --output summary 强制 Apify:python3 skills/blog-scraper/scripts/scrape_blogs.py --urls "https://example.com" --mode apify
模式:auto(默认,RSS 加回退)、rss(仅 RSS)、apify(直接用 Apify actor jupri/rss-xml-scraper)。主要参数:--urls(必填)、--keywords、--days(默认 30)、--max-posts(默认 50)、--mode(默认 auto)、--output(默认 json)、--token(Apify token,仅 Apify 模式或回退需要)、--timeout(默认 300 秒)。
适用场景:监控竞品博客、追踪行业动态。
限制与费用:RSS 模式免费、无 API 与 token;Apify 模式使用 jupri/rss-xml-scraper,会消耗少量 Apify credits。JS 重站点需 Apify 回退且有 token 时才可用。