News Crawler Engineering: Turning News Collection into Production-Grade Data Pipelines

Preface

News site lists are often hidden in APIs, and detail pages may be CSR or require signed requests. Many people write detail parsing first and add pagination and incremental strategies later, resulting in all historical pages being piled up in memory, duplicate entries, and no observable signals after anti-crawler triggers. Below is an introduction to the “News Crawler Engineering” Skill on SkillHub: it uses a fixed engineering workflow to guide Agents from reconnaissance of data sources and table structure design to incremental backfilling, monitoring alerts, and acceptance checklists, transforming one-off scripts into long-running collection pipelines.

What Is This

“News Crawler Engineering” (coordinate @user_756344a1/news-crawler-engineering, version 1.0.2) is a community-sourced (community) Agent Skill, categorized as data-analysis, published by user_756344a1. The Skill does not require an API Key (requires_api_key=false).

The official description explains its purpose: design, implement, review, and harden news/information crawlers to run as production-grade data pipelines; suitable for tasks such as building, analyzing, debugging, or refactoring news site crawlers, market information crawlers, public opinion collection, list/detail extraction, pagination, incremental backfill, anti-crawler analysis, or crawler table design.

Core Features

The Skill content is based on the standard SKILL.md format, with the premise that “one site = one source in the collection system”, mainly covering the following explicitly stated capabilities.

Reconnaissance and Collection Modes

  1. Reconnaissance first: locate the real list API, pagination parameters, column IDs, and detail URL rules; confirm whether the list already includes title, time, source, images, summary, and body text; find clues like ajax, fetch, page, columnId in pages and JS; when involving JS/signatures/cookies, it is recommended to use browser Network, and mentions it can be combined with the user-js-reverse MCP.
  2. Then select mode: if the API contains the full text, use the API as primary; if only the list, then API pagination + detail page for body text; pure static HTML means parsing paginated lists and details; strong CSR/anti-crawler means reverse engineering the API/signature first and then replaying.

Data Model and Field Specifications

  • The main table references get_market_news_info; body text and large fields are placed in get_market_news_content (content, content_html, images, raw_data).
  • Business unique key: UNIQUE KEY uk_source_unique_id (source, source_unique_id); news_id is only for association, not as a unique key for the content table.
  • Field rules include: media_name is the collection site name; original_source is the actual source displayed in the article; summary must not be filled with site fixed descriptions; author must not use editor as a substitute; stock_list is a pure string array like ["AAPL","INTC"]; crawl_error only stores short error messages; site extension fields go into extra_data.
  • Body text success determination: having text means success; no text but with images also counts as success; no text and no images means crawl_status = 4.

Body Text Extraction Priority

  1. API segment/block structure (paragraph boundaries are most accurate).
  2. Known container selectors in HTML detail pages.
  3. Full page get_text() split by lines (last resort).

Paragraphs are separated by \n\n; when text and images are interleaved in block structures, use [Image: caption] placeholder in content, and images stores URLs in order of appearance. The documentation emphasizes: when the Referer or detail URL contains Chinese or other non-ASCII characters, URL encoding is required (e.g., urllib.parse.quote).

Incremental, Backfill, and Storage

Standard strategy: query MAX(publish_time) by source + column_name; if no history, threshold is now - backfill_days (default 90 days); if history exists, max_publish_time - overlap_hours (default 6 hours); traverse by column pagination; batch deduplication per page, fetch details, upsert immediately; if the entire page is earlier than the threshold, stop pagination. Prohibited from accumulating all column history pages in memory and writing them all at once.

Storage requirements: main table and content table in the same transaction; use INSERT ... ON DUPLICATE KEY UPDATE; failed records should also be stored for retry. crawl_status values 1–5 represent success, detail request failure, page structure exception, empty body text, and parsing exception respectively.

Pagination Stop and Stability

Distinguish between “all articles on this page are earlier than the threshold” (should_stop=True, normal termination) and “API failure or empty list” (should_stop=False, accumulate consecutive_empty). Consecutive empty pages (recommended 3 pages) should interrupt and alert. API failures should return ([], False) instead of incorrectly setting should_stop=True.

Monitoring and Alerts (Required by Skill)

Three-level notifications: uncaught exceptions; total_success == 0; detail failure rate exceeding 50%. The Skill provides example structures for main() and Feishu/notifications.

Proxy and Memory

Overseas sites may require direct connections, explicitly proxies={} for default proxies; verify before implementation whether proxies are needed and whether there is TLS fingerprint detection. Task dictionaries only retain fields needed for storage; process page by page to avoid memory accumulation.

Code and Acceptance

Crawler script file headers must include @Desc and 来源url: lines. Before delivery, run through list→detail→parse, and verify table structure, sample dual-table writes, JSON fields, encoding, summary/original_source, re-run skipping already successful rows, failed records retryable, and alert and proxy behavior check items.

Installation and Activation

The installation prompt given by the SkillHub page is: let AI install @user_756344a1/news-crawler-engineering according to the SkillHub installation documentation.

If SkillHub CLI is already installed, installation must use --dir to point to the current Agent’s skills directory, otherwise it will default to ./skills/ and may not be recognized:

command -v skillhub && skillhub --version

skillhub install @user_756344a1/news-crawler-engineering --dir <skills directory>

Common paths (from official installation documentation):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

If CLI is not installed, you can use the official one-click script (complete installation includes CLI and default Skills):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

After installation, the Skill needs to be loaded by the Agent from the skills directory in the corresponding client (some environments require restart or reopening the session). Differences between Codex CLI, Claude Code, and Cursor are mainly reflected in the skills directory location, while the installation command itself is consistent.

Typical Usage

The Skill is triggered by description: when the conversation involves news crawler engineering tasks, the Agent should follow the Workflow in the Skill. Reproducible activation examples:

  1. Install the Skill to the skills directory of the current environment (see the commands in the previous section).
  2. Propose a specific task in clients like Cursor, e.g.: “Build an incremental crawler for a financial news column; the list is POST JSON pagination; design the main table and content table according to the Skill’s table structure, and implement three-level alerts.”
  3. The Agent should first complete the reconnaissance checklist (list API, pagination, whether fields include body text), then output a structured crawler (column configuration, thresholds, per-page deduplication and storage, detail parsing, transactional upsert), and run the script end-to-end according to Verification Checklist requirements.

The Python snippets embedded in the Skill can be used as implementation references; for example, distinguishing raw_tasks and deduplicated tasks in the pagination loop, and the zero-storage and failure rate judgment logic in main(), can all be directly viewed in the installed SKILL.md.

Applicable Scenarios and Notes

Who it’s for: Data engineers, backend or crawler developers who need to turn news/information/market flash collection into maintainable pipelines; teams that need to unify library tables, incremental strategies, field semantics, and review checklists.

Limitations and Notes:

  • The Skill is engineering specifications and process guidance, not a replacement for your compliance review of target sites and robots/Terms of Service constraints; anti-crawler and signature reverse engineering still need to be combined with site strategies and tools like user-js-reverse.
  • The table names in the documentation (like get_market_news_info) come from Skill conventions and need to be aligned with or mapped to your existing library tables when implementing.
  • SkillHub statistics (as of data capture): rating 100000, 3676 downloads; refer to the SkillHub skill page.

Conclusion

“News Crawler Engineering” integrates reconnaissance, mode selection, dual-table model, incremental backfill, pagination semantics, built-in monitoring, and acceptance checklists into the same Skill, suitable for reducing “runs but unstable” crawler delivery when Agent-assisted development is used. Official entry: SkillHub - News Crawler Engineering, API coordinate page: https://api.skillhub.cn/user_756344a1/news-crawler-engineering.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye