# Cnki Search

Search CNKI (中国知网) for papers by keyword.

- Repository: https://github.com/cookjohn/cnki-skills (1031 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-03-13
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add cookjohn/cnki-skills --skill cnki-search -g -a claude-code -y`
Codex: `npx skills add cookjohn/cnki-skills --skill cnki-search -g -a codex -y`
Cursor: `npx skills add cookjohn/cnki-skills --skill cnki-search -g -a cursor -y`
Gemini CLI: `npx skills add cookjohn/cnki-skills --skill cnki-search -g -a gemini-cli -y`

## Description

Search CNKI (中国知网) for papers by keyword. Use when the user wants to find academic papers on a topic.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# CNKI Basic Search

Search CNKI for papers using keyword(s). Returns result count and structured result list (titles, URLs, authors, journal, date) in a single call.

## Arguments

$ARGUMENTS contains the search keyword(s) in Chinese or English.

## Steps

### 1. Navigate

Use `mcp__chrome-devtools__navigate_page` → `https://kns.cnki.net/kns8s/search`

### 2. Search + extract results (single evaluate_script, NO wait_for)

Replace `YOUR_KEYWORDS` with actual search terms:

```javascript
async () => {
  const query = "YOUR_KEYWORDS";

  // Wait for search input (replaces wait_for)
  await new Promise((r, j) => {
    let n = 0;
    const c = () => { if (document.querySelector('input.search-input')) r(); else if (++n > 30) j('timeout'); else setTimeout(c, 500); };
    c();
  });

  // Check captcha (only if visible on screen, not hidden SDK at top:-1000000)
  const outer = document.querySelector('#tcaptcha_transform_dy');
  if (outer && outer.getBoundingClientRect().top >= 0) return { error: 'captcha' };

  // Fill and submit (verified selectors: input.search-input, input.search-btn)
  const input = document.querySelector('input.search-input');
  input.value = query;
  input.dispatchEvent(new Event('input', { bubbles: true }));
  document.querySelector('input.search-btn')?.click();

  // Wait for results
  await new Promise((r, j) => {
    let n = 0;
    const c = () => { if (document.body.innerText.includes('条结果')) r(); else if (++n > 30) j('timeout'); else setTimeout(c, 500); };
    c();
  });

  // Check captcha again
  const outer2 = document.querySelector('#tcaptcha_transform_dy');
  if (outer2 && outer2.getBoundingClientRect().top >= 0) return { error: 'captcha' };

The rest: https://github.com/cookjohn/cnki-skills/blob/HEAD/skills/cnki-search/SKILL.md
