Commit a5e2bf93 authored by 谢宇轩's avatar 谢宇轩

feat: add ft source

parent 89df597f
{
"format": "news-harvester-source",
"version": 1,
"exportedAt": "2026-09-08T07:28:27.604Z",
"source": {
"id": "ft",
"name": "金融时报",
"homepageUrl": "https://www.ft.com/news-feed",
"method": "browser",
"vaultFolder": "金融时报"
},
"files": {
"helpers/ft.md": "---\nsource: ft\nlistSelector: \"div.o-teaser__heading\"\nlinkSelector: 'a[href]'\nurlPattern: 'www\\.ft\\.com/content/.+'\nexcludeUrlPattern: null\nscrollSteps: 3\nscrollWaitMs: 2000\nwaitMs: 15000\n# ── 翻页(可选)── 站点把文章列表分多页时启用。两种模式互斥,最多配一个。\n# 配了翻页字段后还需在 config.json 该 source 下设 paginate: true 才生效。\npageUrlTemplate: 'https://www.ft.com/news-feed?page={page}'\npageStart: 2\nmaxPages: 5\npageWaitMs: null\nbodySelectors:\n - '[data-testid^=\"paragraph\"]'\n - '[class*=\"articleBodyContent\"] p'\n - '[class*=\"article-body\"] p'\n - 'article p'\nbodyMinParagraphs: 3\ndateSelector: 'time[datetime]'\nauthorSelector: '[rel=\"author\"], [class*=\"author\"] a'\n# Scope to the article-body container (e.g. '[class*=\"ArticleBody\"] img, article img')\n# so bottom-of-page \"recommended articles\" thumbnails aren't downloaded into assets/.\nimageSelector: 'img'\nimageMinWidth: 200\nexcludeImage:\n - logo\n - icon\n - avatar\n - profile\n# excludeImageSelector drops imgs whose ancestor matches — use for\n# \"recommended/related articles\" thumbnails sharing the hero image's CDN host.\n# excludeImageSelector: '[class*=\"RelatedArticle\"], [class*=\"RecommendedArticle\"]'\ntitleStripSuffix: ''\nmaxBodyChars: 15000\n---\n# 金融时报 抓取备忘\n\n- 主文章流容器 `div.o-teaser__heading` 实测 25 个候选链接(inspect 自动生成)。\n- urlPattern `www\\.ft\\.com/content/.+` 由样本 URL 推断,如 preview 漏抓/误抓请手编收紧。\n- 首屏可能不全,scrollSteps=3 触发懒加载;反爬严重时调高 waitMs。\n- 验证: node scripts/preview.js --url https://www.ft.com/news-feed --recipe helpers/ft.md --count 3(链接为真实文章且 charCount>500 即通过)",
"helpers/ft.fixtures.json": "{\n \"articles\": [\n \"https://www.ft.com/content/0815cd34-bf4c-4771-8bf5-710eff286763\",\n \"https://www.ft.com/content/1f71d2d0-d2e2-46da-a96f-99d20936223e\",\n \"https://www.ft.com/content/0bdd8292-efaa-4329-b41e-d81a5063c4c0\"\n ],\n \"sections\": [\n \"https://www.ft.com/world\",\n \"https://www.ft.com/technology\"\n ],\n \"minLinks\": 15\n}\n"
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment