Skip to content
alyn
cookjohn

Cnki Parse Results skill

Parse current CNKI search results page into structured paper data (title, authors, journal, date, citations). Use after a search has been performed and you need to extract the results.

$npx skills add cookjohn/cnki-skills --skill cnki-parse-results
View this skill on GitHubcookjohn/cnki-skills/skills/cnki-parse-results/SKILL.md
Pack stars
1,059
Pack installs
6.1k
Alyn Score
45/99
Updated
8 months ago
– views – installs via Alyn

Install Cnki Parse Results

Pick your agent. Every command is ready to paste.

$npx skills add cookjohn/cnki-skills --skill cnki-parse-results

The open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.

01

Install it

Run the command above, or upload the folder in Claude.

02

Ask naturally

Describe the task. Your agent loads cnki-parse-results when the request matches its description.

03

Name it if needed

If it does not trigger, say “use the cnki-parse-results skill”. In Codex, type $cnki-parse-results.

The skill itself

SKILL.md

FolderGitHub

CNKI Parse Search Results

Extract structured paper data from the current CNKI search results page.

Prerequisites

The current Chrome page must be a CNKI search results page (URL contains kns.cnki.net and page shows "条结果").

Steps

1. Verify we are on a results page

Use mcp__chrome-devtools__take_snapshot. Verify the page contains "条结果". If not, inform the user that no search results page is currently open.

Check for captcha ("拖动下方拼图完成验证") - if found, notify user to solve it manually.

2. Extract results via JavaScript

Use mcp__chrome-devtools__evaluate_script with this function:

() => {
  const rows = document.querySelectorAll('.result-table-list tbody tr');
  const checkboxes = document.querySelectorAll('.result-table-list tbody input.cbItem');
  const results = Array.from(rows).map((row, index) => {
    const nameCell = row.querySelector('td.name');
    const titleLink = nameCell?.querySelector('a.fz14');
    const authorCell = row.querySelector('td.author');
    const sourceCell = row.querySelector('td.source');
    const dateCell = row.querySelector('td.date');
    const dataCell = row.querySelector('td.data');
    const quoteCell = row.querySelector('td.quote');
    const downloadCell = row.querySelector('td.download');
    const isOnlineFirst = !!nameCell?.querySelector('.marktip');

    return {
      number: index + 1,
      title: titleLink?.innerText?.trim() || '',
      url: titleLink?.href || '',
      exportId: checkboxes[index]?.value || '',
      authors: Array.from(authorCell?.querySelectorAll('a.KnowledgeNetLink') || []).map(a => a.innerText?.trim()),
      journal: sourceCell?.querySelector('a')?.innerText?.trim() || '',
      date: dateCell?.innerText?.trim() || '',
      database: dataCell?.innerText?.trim() || '',
      citations: quoteCell?.innerText?.trim() || '',
      downloads: downloadCell?.innerText?.trim() || '',
      isOnlineFirst: isOnlineFirst
    };
  });

  const totalText = document.querySelector('.pagerTitleCell')?.innerText || '';
  const totalMatch = totalText.match(/([\d,]+)/);
  const pageInfo = document.querySelector('.countPageMark')?.innerText || '';

  return {
    papers: results,
    totalCount: totalMatch ? totalMatch[1] : 'unknown',
    pageInfo: pageInfo
  };
}

3. Present results

Format as a numbered list:

CNKI search results ({totalCount} total, page {pageInfo}):

1. {title} {isOnlineFirst ? "[网络首发]" : ""}
   Authors: {authors joined by "; "}
   Journal: {journal} | Date: {date} | Type: {database}
   Citations: {citations} | Downloads: {downloads}
   URL: {url}

2. ...

4. Fallback: snapshot-based parsing

If JavaScript returns empty (DOM structure changed), use mcp__chrome-devtools__take_snapshot and parse the accessibility tree manually:

Look for the repeating pattern:

  • checkbox → StaticText (number) → link with URL containing kcms2/article/abstract (title) → links with URL containing kcms2/author/detail (authors) → link with URL containing navi.cnki.net/knavi/detail (journal) → StaticText (date) → StaticText (database type)

Verified DOM Selectors (CNKI uses jQuery, stable semantic class names)

Data Selector Notes
Table .result-table-list tbody tr Each row = one paper
Checkbox input.cbItem value = export encrypted ID
Number td.seq Row sequence number
Title td.name a.fz14 Paper title link
Authors td.author a.KnowledgeNetLink Author name links
Journal td.source a Journal/source link
Date td.date Publication date text
DB Type td.data Database type (期刊/学位论文)
Citations td.quote Citation count
Downloads td.download Download count
Online 1st td.name .marktip "网络首发" label
Total .pagerTitleCell "共找到 X 条结果"
Page .countPageMark "1/300" format

Tips for Cnki Parse Results

  • • Start a fresh session after installing so your agent picks up the new skill.
  • • It is part of a pack with 10 skills. Install only the ones you need with --skill to keep triggers precise.
  • • If two skills overlap, mention the one you want by name.

Questions about Cnki Parse Results

What does the Cnki Parse Results skill do?

Parse current CNKI search results page into structured paper data (title, authors, journal, date, citations). Use after a search has been performed and you need to extract the results.

How do I install Cnki Parse Results?

Run "npx skills add cookjohn/cnki-skills --skill cnki-parse-results" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.

Does Cnki Parse Results work in Cursor and Codex?

Yes. Cnki Parse Results uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.

Is Cnki Parse Results free?

Cnki Parse Results is open source on GitHub. It is free to install; check the license before commercial use.

Who made Cnki Parse Results?

Cnki Parse Results is published by cookjohn in the cookjohn/cnki-skills repository, together with 9 other skills.

Similar skills. From other creators.