- investing.com 反爬策略调整(Google News RSS + magic/stealth) - forexlive→investinglive 迁移 - 各源抓取状态表更新 Co-Authored-By: Claude <noreply@anthropic.com>
4.9 KiB
4.9 KiB
continuation.md — English Financial News 项目状态
最后更新:2026-07-23
2026-07-23 会话成果
investing.com 反爬策略调整
问题: RSS 返回 403(Cloudflare),Web headful 间歇性失败(数据中心 IP 被标记)
改动:
| 文件 | 改动内容 |
|---|---|
crawler/crawler.py |
magic=True + enable_stealth=True Crawl4AI/Playwright 全自动反检测;--disable-webrtc 防止 IP 泄露;delay_before_return_html=3s 等待 Cloudflare 挑战;remove_consent_popups=True 自动关弹窗;wait_until="domcontentloaded" 避免被 Cloudflare 阻塞;增加列表页 URL 过滤(most-popular-news/trending 等) |
crawler/rss_crawler.py |
新增 _make_rss_client() 读取 system.yaml 代理配置创建 httpx 客户端;Google News RSS 跳过 article_url_pattern 域名过滤 |
configs/sources.yaml |
investing.com:rss_url 切换为 Google News RSS 代理(绕过 Cloudflare),增加 anti_bot_mode: stealth;forexlive → investinglive 迁移 |
scripts/domestic_crawl_8g.sh |
HTTP_PROXY/HTTPS_PROXY 移至 .env 加载之前,确保 httpx 继承代理 |
测试结果(investing.com):
| 策略 | 结果 |
|---|---|
| Google News RSS(代理) | ✅ 25/25 篇,423 words/篇平均 |
| Web headful 首页 | ✅ 可加载,提取 ~25 个文章链接(15s) |
| Web headful 文章页 | ❌ 所有文章页仍被 Cloudflare 拦截(403) |
forexlive → investinglive 迁移
问题: forexlive.com 域名 301 重定向到 investinglive.com,_is_valid_article_url 域名过滤拒绝所有链接
改动: sources.yaml — 移除 forexlive 源,新增 investinglive 源
| 字段 | 旧值 | 新值 |
|---|---|---|
| id | forexlive |
investinglive |
| name | ForexLive | InvestingLive |
| homepage | forexlive.com/ |
investinglive.com/ |
| rss_url | forexlive.com/feed |
investinglive.com/feed |
| article_url_pattern | /(news|technical-analysis|Education)/ |
/(news|central-banks|commodities|stocks|technical-analysis)/ |
| max_articles | 20 | 25 |
测试结果: ✅ found=25 success=25,100%,全文 3-9KB/篇(RSS 内嵌完整正文)
当前进度
M0 ✅ 项目骨架
M1 ✅ 新闻抓取(13/13 源,Pi headful Playwright + HTTP 代理)
M2 ✅ 正文提取(trafilatura + MD 回退,增量跳过已处理)
M3 ✅ 三层去重(L1 URL / L2 Content / L3 SimHash,SQLite 指纹库)
M4 ✅ 翻译+事件抽取(DeepSeek v4-flash,事件去重 Prompt 约束)
M5 ✅ 向量生成(DashScope text-embedding-v3,1024 维)
M6 ✅ Qdrant 入库(本地文件模式,语义搜索验证)
M7 ✅ 全链路管道 + 日报(事件级去重 + AI 摘要分批合并 + 防截断)
M8 ✅ MCP 服务(FastMCP 5 个 Tool)
各源抓取状态
| 源 | 策略 | 状态 | 说明 |
|---|---|---|---|
| Reuters | Google News RSS | ⚠️ 摘要,RSS 稳定 | DataDome 反爬无法突破 |
| CNBC | CNBC RSS | ✅ 稳定 | 原生 RSS 正常 |
| MarketWatch | RSS + stealth | ✅ 稳定 | RSS 优先,stealth 回退 |
| FT | FT RSS | ⚠️ 摘要,RSS 稳定 | 付费墙,全文不可用 |
| Yahoo Finance | Yahoo RSS | ✅ 稳定 | RSS 正常 |
| Investing.com | Google News RSS + stealth | ✅ RSS 25/篇,Web ❌ | 2026-07-23 修复:RSS 改用 Google News 代理 |
| Seeking Alpha | RSS + stealth | ✅ 稳定 | RSS 稳定 |
| Barron's | Dow Jones RSS + stealth | ✅ 稳定 | 无原生 RSS,Dow Jones 兜底 |
| WSJ | Dow Jones RSS + stealth | ✅ 稳定 | RSS 正常 |
| Economist | RSS + stealth | ✅ 稳定 | RSS 正常 |
| InvestingLive | RSS | ✅ 25/篇 100% | 2026-07-23 新增(forexlive 迁移) |
| ZeroHedge | FeedBurner RSS | ✅ 稳定 | RSS 含全文 |
| 已替换为 InvestingLive |
待办事项
- Investing.com 全文抓取 — Google News RSS 仅摘要,Web headful 仍被 Cloudflare 拦截(需要更好代理线路或住宅 IP)
- Reuters 全文 — 同上,DataDome 需要更先进的代理
- FT 付费墙 — 需要付费订阅或放弃全文
- 海外服务器 crontab 停用 — 确认不再参与流水线后清理
- Pi crontab 确认 — 当前
logs/full.log显示调度正常运行(06/12/18/22 四个时间点)
服务器状态
| 角色 | 地址 | 路径 | 状态 |
|---|---|---|---|
| 海外 | ecs-user@8.217.19.253 |
/opt/intlgrab |
⏸️ 不再参与流水线 |
| 国内 | pi@192.168.1.160 |
/home/pi/intlnews |
✅ 全链路独立运行 |
CLI 命令速查
bash scripts/domestic_full.sh 全流程(M1→M6→日报)
bash scripts/domestic_crawl_8g.sh 仅 M1 headful(可跟源 ID)
bash scripts/domestic_crawl_8g.sh investing 单源测试
PYTHONPATH=. .venv/bin/python3 -c "..." 直接调用 orchestrator