Dynamic Content Extraction 标志

Dynamic Content Extraction

社区
AtlasOmnia
dynamic-content-extraction

dynamic-content-extraction — Extract structured data from JavaScript-heavy sites where prices, text, or key fields don't appear in the standard accessibility tree. Covers browser_snapshot(full=true), TreeWalker text-node extraction, lazy-load handling, and React split-text recovery.

概览

发布者AtlasOmnia
代码仓库donna-starter
技能名称dynamic-content-extraction
星标数
131
复刻数
9
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 AtlasOmnia 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Dynamic Content Extraction AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/AtlasOmnia/donna-starter/tree/main/skills/research/dynamic-content-extraction
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AtlasOmnia/donna-starter.git /tmp/donna-starter
mkdir -p .claude/skills
cp -r /tmp/donna-starter/skills/research/dynamic-content-extraction .claude/skills/dynamic-content-extraction
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Dynamic Content Extraction,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Dynamic Content Extraction。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Dynamic Content Extraction 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Dynamic Content Extraction

Extract structured data (prices, listings, product details) from JavaScript-heavy sites where key data is rendered by React/Vue/Angular and doesn't appear in compact accessibility snapshots.

When to Use

  • Extracting prices, inventory, or listings from booking/retail/travel sites (IHG, Marriott, Booking.com, Amazon, etc.)
  • Data is visible on screen but absent from browser_snapshot (compact mode)
  • web_extract times out or returns empty content
  • Direct API calls are blocked by CDN/WAF (Akamai, Cloudflare)
  • Vision model reads are inconsistent for exact numeric data
  • the user asks for browser/search/internet tool inventory, fallback order, or says to check the vault for web tooling
  • Estimating market-wide keyword demand when the request is phrased as “check Google Analytics” or a chart/API is rendered only in page JavaScript

References:

  • If a browser/search/internet tool inventory or fallback order is needed, inspect the environment's own tool catalog at runtime rather than relying on a static vault note.
  • distinguishes Analytics, Search Console, Keyword Planner, Trends, and SEO volume datasets; it includes same-origin Google Trends widget extraction and concise reporting guidance.
  • documents the live OpenRouter model-performance endpoint, extraction code, metric interpretation, specialty-model screening, and Nitro routing.

Workflow

1. Start with full snapshot

browser_snapshot(full=true) — compact mode (full=false, the default) often omits dynamically-injected prices and numbers. Full mode surfaces text from the complete accessibility tree.

Pitfall: Full snapshots on listing pages are often truncated (300-500 lines). Accept this and scroll + re-extract in batches.

2. Scroll to trigger lazy loading

Modern sites (IHG, Airbnb, Expedia) only render ~5-15 cards initially. Scroll 4-6 times before extraction:

browser_scroll(direction='down') # repeat 3-6 times

Then wait 2-3 seconds for React to hydrate new cards.

3. Extract via TreeWalker (React split-text recovery)

React and similar frameworks often split text across sibling elements. Example from IHG:

html
<span><span>156</span><span> USD</span></span>

The number "156" and "USD" are separate text nodes — regex on parent textContent works but may merge adjacent values.

Preferred pattern — TreeWalker for leaf text nodes:

js
(() => {
 const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
 const results = [];
 let node;
 while (node = walker.nextNode()) {
 const text = node.textContent.trim();
 // Match data patterns (prices, ratings, etc.)
 if (/^\d{2,4}$/.test(text) && node.parentElement.textContent.includes('USD')) {
 const price = parseInt(text);
 // Walk up to find container card
 let card = node.parentElement;
 for (let i = 0; i < 15 && card; i++) {
 const h2 = card.querySelector('h2');
 if (h2) {
 results.push({ name: h2.textContent.trim(), price });
 break;
 }
 card = card.parentElement;
 }
 }
 }
 return results;
})()

4. Walk up from data nodes to cards

Data nodes (price, rating) live deep inside React component trees. Walk up 10-15 levels to find the card container, then query inside it for other fields (name, distance, reviews).

Pattern:

price text node → parent → ... (walk up) → card container → querySelector('h2')

5. Cross-validate with snapshot data

Use browser_snapshot to cross-check hotel names and amenities, since the accessibility tree reliably captures headings and static text labels — just not the prices.

6. Discover and query same-origin frontend data APIs

When the page offers a useful sort/filter but the accessibility tree omits the underlying numbers:

  1. Inspect performance.getEntriesByType('resource') for same-origin frontend/API requests.
  2. If the UI's internal sort value is unclear, search loaded JavaScript chunks for the visible option label and recover its enum or query parameter.
  3. Reproduce the request with fetch() inside browser_console, inspect the response shape, then join records through stable IDs rather than parsing rendered cards.
  4. Preserve metric window, percentile, sample count, provider, and units in the result. Live rankings without those fields are easy to overstate.
  5. Classify specialized entries before recommending them; a raw throughput leader may be a moderation, image, code-apply, or multi-agent model rather than a general assistant.

Pitfalls

  • Confirm the active browser target on multi-tab/social sites. browser_console can evaluate against the wrong tab or a browser new-tab surface after redirects/login flows. If the snapshot shows the target page but console reads chrome://new-tab-page/ or unrelated content, call browser_cdp(method='Target.getTargets'), pick the type='page' target with the desired URL, then run Runtime.evaluate against that target_id to extract document.body.innerText.
  • For login-gated social pages, separate access verification from management actions. After the user signs in, first verify the resolved URL, visible page title/name, follower/like counts, description/about text, and whether management controls are present. Do not switch profiles, edit settings, create ads, send messages, or otherwise mutate the account unless the user explicitly asks.
  • Don't trust vision for exact numbers. Vision models conflate similar hotel names (avid ↔ EVEN), misread prices, and hallucinate hotels that aren't on screen. Use vision only as a last resort for layout questions.
  • web_extract fails on SPAs. JS-heavy booking sites routinely time out (60s). Don't retry — go straight to browser tools.
  • CDP Network domain may be unavailable. Don't assume Network.getAllCookies or Network.getResponseBody work in all browser sessions. Fall back to in-console fetch() calls from the same origin.
  • Direct API calls get Akamai/Cloudflare blocks. Don't waste time on curl to booking-site APIs. Use the browser's authenticated session via browser_console fetch().
  • Sort dropdowns may not respond to browser_click. React-controlled custom dropdowns often ignore synthetic clicks. Try URL parameter manipulation instead (look for qSrt, sort, order params).
  • Lazy loading means one extraction never gets everything. Scroll → wait → extract in a loop. Accept partial coverage and report how many of the total were captured.
  • textContent merging corrupts adjacent fields. When "rating 4.5" and "2920 reviews" appear in sibling elements, textContent returns "rating 4.52920 reviews". Extract from leaf text nodes individually instead.

常见问题

Dynamic Content Extraction AI 技能有什么作用?

dynamic-content-extraction — Extract structured data from JavaScript-heavy sites where prices, text, or key fields don't appear in the standard accessibility tree. Covers browser_snapshot(full=true), TreeWalker text-node extraction, lazy-load handling, and React split-text recovery.

为什么在 TypingMind 中使用 Dynamic Content Extraction?

因为您只需安装一次,就能搭配任何模型使用。Dynamic Content Extraction 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Dynamic Content Extraction?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/AtlasOmnia/donna-starter/tree/main/skills/research/dynamic-content-extraction。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Dynamic Content Extraction?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Dynamic Content Extraction 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Dynamic Content Extraction 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Dynamic Content Extraction AI 技能免费吗?

是的。AtlasOmnia 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇