微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📰

零成本本地金融新闻库

finviz-crawler · v2.0.0
效率 安全 B 级 作者 camopel 公开目录收录
1.3k 下载 0 安装 6.1k 收藏 31 浏览

简介

本地金融新闻爬虫,持续抓取 Finviz 头条并构建可查询的 SQLite 档案,零 API 成本,适合自动化市场监控与 AI 摘要生成。

原始描述

Continuous financial news crawler for finviz.com with SQLite storage, article extraction, and query tool. Use when monitoring financial markets, building new...

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/finviz-crawler/
其它 Agent解压到它自己的 skills 目录,目录名用 finviz-crawler

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心用法

finviz-crawler 是一套面向个人投资者与量化研究者的持续型金融新闻采集系统。与一次性 API 调用不同,它以守护进程形式长期运行,通过 Crawl4AI + Playwright 实时抓取 finviz.com/news.ashx 的头条列表,并自动提取 Bloomberg、Reuters、Yahoo Finance、CNBC 等信源的全文内容,存储于本地 SQLite 数据库与 Markdown 文件中。

主脚本 finviz_crawler.py 支持高度可配置:自定义数据目录、抓取间隔(默认 5 分钟)、文章有效期(默认 7 天自动清理)。配套查询工具 finviz_query.py 提供只读访问,可按时间窗口过滤、导出标题或全文,输出格式针对 LLM 摘要优化(纯文本/JSON)。

显著优点

  • 零成本架构:无需 API Key、订阅或注册,直接抓取公开 RSS 与网页。
  • 本地持久化:构建个人历史档案,突破 API 调用频次与数据保留期限限制。
  • 自动化就绪:原生支持 systemd/launchd 后台服务化,结合 cron 可实现每日晨报、晚报、周报等自动化投研工作流。
  • 智能清洗:SHA-256 去重、Bot 检测规避、按域名限速、User-Agent 轮换,降低被封风险。
  • AI 友好输出:查询工具专为 LLM 上下文设计,便于接入 OpenClaw 的自动化摘要管道。

潜在缺点与局限性

  • 法律与合规风险:未经授权抓取 Finviz 及下游信源可能违反服务条款,商业用途需额外评估。
  • 结构脆弱性:网站改版、反爬升级或 Cloudflare 等防护机制可能导致抓取失效;无官方 SLA 保障。
  • 数据完整性:Paywall 内容依赖 RSS 摘要,部分全文可能缺失;Bot 检测机制可能误杀有效内容。
  • 本地资源占用:Playwright Chromium 实例持续运行,内存与磁盘(文章 Markdown)占用随时间增长。
  • 时区与过期策略:默认以系统时区处理时间戳,跨平台行为可能不一致;--expiry-days 0 无限保留需手动监控磁盘。

适合人群

  • 个人投资者、量化研究员、财经自媒体,需要低成本、可定制的本地新闻数据库。
  • 已具备 Python/Playwright 运维经验,能够处理潜在的反爬对抗与环境配置问题。
  • 希望将新闻摘要集成到自动化工作流(如 Telegram/Discord 每日推送)的技术用户。

常规风险

  • IP 封禁:高频抓取可能触发目标站点限制,建议配合代理或降低 --sleep 频率。
  • 数据隐私:本地存储的文章可能包含敏感市场信息,需妥善备份与加密。
  • 依赖维护:Crawl4AI、Playwright 版本迭代可能引入破坏性变更,需定期更新与回归测试。

技能正文


name: finviz-crawler description: Continuous financial news crawler for finviz.com with SQLite storage, article extraction, and query tool. Use when monitoring financial markets, building news digests, or needing a local financial news database. Runs as a background daemon or systemd service. metadata: {"openclaw":{"requires":{"bins":["python3"]}}}

finviz-crawler

Why This Skill?

📰 Your own financial news database — most finance skills just wrap an API for one-shot queries. This skill runs continuously, building a local archive of every headline and article from Finviz. Query your history anytime — no API limits, no missing data.

🆓 No API key, no subscription — scrapes finviz.com directly using Crawl4AI + RSS. Bloomberg, Reuters, Yahoo Finance, CNBC articles extracted automatically. Zero cost.

🤖 Built for AI summarization — the query tool outputs clean text/JSON optimized for LLM digests. Pair with an OpenClaw cron job for automated morning briefings, evening wrap-ups, or weekly investment summaries.

💾 Auto-cleanup — configurable expiry automatically deletes old articles from both the database and disk. Set --expiry-days 30 to keep a month of history, or 0 to keep everything forever.

🔄 Daemon architecture — runs as a background service that starts/stops with OpenClaw. No manual intervention needed after setup. Works with systemd (Linux) and launchd (macOS).

Install

python3 scripts/install.py

Works on macOS, Linux, and Windows. Installs Python packages (crawl4ai, feedparser), sets up Playwright browsers, creates data directories, and verifies everything.

Manual install

pip install crawl4ai feedparser
crawl4ai-setup  # or: python -m playwright install chromium

Usage

Run the crawler

# Default: ~/Downloads/Finviz/, 7-day expiry
python3 scripts/finviz_crawler.py

# Custom paths and settings
python3 scripts/finviz_crawler.py --db /path/to/finviz.db --articles-dir /path/to/articles/

# Keep 30 days of articles
python3 scripts/finviz_crawler.py --expiry-days 30

# Never auto-delete (keep everything)
python3 scripts/finviz_crawler.py --expiry-days 0

# Custom crawl interval (default: 300s)
python3 scripts/finviz_crawler.py --sleep 600

Query articles

# Last 24 hours of headlines
python3 scripts/finviz_query.py --hours 24

# Titles only (compact, good for LLM summarization)
python3 scripts/finviz_query.py --hours 12 --titles-only

# With full article content
python3 scripts/finviz_query.py --hours 12 --with-content

# Database stats
python3 scripts/finviz_query.py --stats

Configuration

Setting CLI flag Env var Default
Database path --db — ~/Downloads/Finviz/finviz.db
Articles directory --articles-dir — ~/Downloads/Finviz/articles/
Crawl interval --sleep — 300 (5 min)
Article expiry --expiry-days FINVIZ_EXPIRY_DAYS 7 days
Timezone — FINVIZ_TZ or TZ System default

Architecture

Crawler daemon (finviz_crawler.py):

  • Crawls finviz.com/news.ashx headlines every 5 minutes
  • Fetches article content via Crawl4AI (Playwright) or RSS (paywalled sites)
  • Bot/paywall detection rejects garbage content
  • Per-domain rate limiting, user-agent rotation
  • Deduplicates via SHA-256 title hash
  • Auto-expires old articles (configurable)
  • Clean shutdown on SIGTERM/SIGINT

Query tool (finviz_query.py):

  • Read-only SQLite queries (no HTTP, stdlib only)
  • Filter by time window, export titles or full content
  • Designed for LLM summarization pipelines

Run as a service (optional)

systemd (Linux)

[Unit]
Description=Finviz News Crawler

[Service]
ExecStart=python3 /path/to/scripts/finviz_crawler.py --expiry-days 30
Restart=on-failure
RestartSec=30

[Install]
WantedBy=default.target

launchd (macOS)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key><string>com.finviz.crawler</string>
    <key>ProgramArguments</key>
    <array>
        <string>python3</string>
        <string>/path/to/scripts/finviz_crawler.py</string>
        <string>--expiry-days</string>
        <string>30</string>
    </array>
    <key>RunAtLoad</key><true/>
    <key>KeepAlive</key><true/>
</dict>
</plist>

Data layout

~/Downloads/Finviz/
├── finviz.db          # SQLite: metadata, URLs, timestamps, hashes
└── articles/          # Full article content as .md files

Cron integration

Pair with an OpenClaw cron job for automated digests:

Schedule: 0 6 * * * (6 AM daily)
Task: Query last 24h → LLM summarize → deliver to Matrix/Telegram/Discord

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

web-scrapingfinancial-datanews-aggregatorsqliteautomationcrawl4aidaemonquantitative-research

同类 Skill