cnki-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

CNKI Basic Search

CNKI 基础搜索

Search CNKI for papers using keyword(s). Returns result count and structured result list (titles, URLs, authors, journal, date) in a single call.
通过关键词搜索CNKI的论文。单次调用即可返回结果数量以及结构化结果列表(标题、URL、作者、期刊、日期)。

Arguments

参数

$ARGUMENTS contains the search keyword(s) in Chinese or English.
$ARGUMENTS中包含中文或英文的搜索关键词。

Steps

步骤

1. Navigate

1. 导航

Use
mcp__chrome-devtools__navigate_page
https://kns.cnki.net/kns8s/search
使用
mcp__chrome-devtools__navigate_page
https://kns.cnki.net/kns8s/search

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

2. 搜索 + 提取结果(单次evaluate_script,无需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' };

  // Extract current page results (merged parse-results)
  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, i) => {
    const titleLink = row.querySelector('td.name a.fz14');
    const authors = Array.from(row.querySelectorAll('td.author a.KnowledgeNetLink') || []).map(a => a.innerText?.trim());
    const journal = row.querySelector('td.source a')?.innerText?.trim() || '';
    const date = row.querySelector('td.date')?.innerText?.trim() || '';
    const citations = row.querySelector('td.quote')?.innerText?.trim() || '';
    const downloads = row.querySelector('td.download')?.innerText?.trim() || '';
    return {
      n: i + 1,
      title: titleLink?.innerText?.trim() || '',
      href: titleLink?.href || '',
      exportId: checkboxes[i]?.value || '',
      authors: authors.join('; '),
      journal,
      date,
      citations,
      downloads
    };
  });

  return {
    query,
    total: document.querySelector('.pagerTitleCell')?.innerText?.match(/([\d,]+)/)?.[1] || '0',
    page: document.querySelector('.countPageMark')?.innerText || '1/1',
    results
  };
}
YOUR_KEYWORDS
替换为实际搜索词:
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' };

  // Extract current page results (merged parse-results)
  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, i) => {
    const titleLink = row.querySelector('td.name a.fz14');
    const authors = Array.from(row.querySelectorAll('td.author a.KnowledgeNetLink') || []).map(a => a.innerText?.trim());
    const journal = row.querySelector('td.source a')?.innerText?.trim() || '';
    const date = row.querySelector('td.date')?.innerText?.trim() || '';
    const citations = row.querySelector('td.quote')?.innerText?.trim() || '';
    const downloads = row.querySelector('td.download')?.innerText?.trim() || '';
    return {
      n: i + 1,
      title: titleLink?.innerText?.trim() || '',
      href: titleLink?.href || '',
      exportId: checkboxes[i]?.value || '',
      authors: authors.join('; '),
      journal,
      date,
      citations,
      downloads
    };
  });

  return {
    query,
    total: document.querySelector('.pagerTitleCell')?.innerText?.match(/([\d,]+)/)?.[1] || '0',
    page: document.querySelector('.countPageMark')?.innerText || '1/1',
    results
  };
}

3. Report

3. 结果汇报

Present results as a numbered list:
Searched CNKI for "$ARGUMENTS": found {total} results (page {page}).

1. {title}
   Authors: {authors} | Journal: {journal} | Date: {date}
   Citations: {citations} | Downloads: {downloads}

2. ...
将结果以编号列表形式呈现:
在CNKI中搜索“$ARGUMENTS”:找到{total}条结果(第{page}页)。

1. {title}
   作者:{authors} | 期刊:{journal} | 日期:{date}
   被引量:{citations} | 下载量:{downloads}

2. ...

4. Follow-up: navigate to a paper

4. 后续操作:跳转至论文详情页

When the user wants to open or download a specific paper, use
navigate_page
with the result's
href
URL directly — do NOT click the link (clicking opens a new tab and wastes 3 extra tool calls for tab management).
当用户想要打开或下载某篇特定论文时,直接使用
navigate_page
工具访问结果中的
href
链接——不要点击链接(点击会打开新标签页,且会额外消耗3次工具调用用于标签页管理)。

Captcha detection

验证码检测

Check
#tcaptcha_transform_dy
element's
getBoundingClientRect().top >= 0
. Tencent captcha SDK preloads DOM at
top: -1000000px
(off-screen, not active). Only return
error: 'captcha'
when
top >= 0
(actually visible to user).
检查
#tcaptcha_transform_dy
元素的
getBoundingClientRect().top >= 0
。腾讯验证码SDK会预加载DOM并设置
top: -1000000px
(屏幕外,未激活状态)。仅当
top >= 0
(对用户可见)时,返回
error: 'captcha'

Verified selectors

已验证的选择器

ElementSelectorNotes
Search input
input.search-input
id=
txt_search
, placeholder "中文文献、外文文献"
Search button
input.search-btn
type="button"
Result count
.pagerTitleCell
text "共找到 X 条结果"
Page indicator
.countPageMark
text "1/300"
Result rows
.result-table-list tbody tr
Each row = one paper
Title link
td.name a.fz14
Paper title with href
Authors
td.author a.KnowledgeNetLink
Author name links
Journal
td.source a
Journal/source link
Date
td.date
Publication date text
Citations
td.quote
Citation count
Downloads
td.download
Download count
元素选择器说明
搜索输入框
input.search-input
id=
txt_search
,占位符“中文文献、外文文献”
搜索按钮
input.search-btn
type="button"
结果数量
.pagerTitleCell
文本“共找到 X 条结果”
页码指示器
.countPageMark
文本“1/300”
结果行
.result-table-list tbody tr
每行对应一篇论文
标题链接
td.name a.fz14
包含论文标题和链接
作者
td.author a.KnowledgeNetLink
作者名称链接
期刊
td.source a
期刊/来源链接
日期
td.date
发表日期文本
被引量
td.quote
被引用次数
下载量
td.download
下载次数

Batch export to Zotero

批量导出至Zotero

When user wants to save results to Zotero, use batch export directly from the results page — do NOT navigate to each detail page. The
exportId
in results equals the detail page's
#export-id
. Call
cnki-export
skill with batch mode (Step 1B). See cnki-export SKILL.md for details.
当用户想要将结果保存至Zotero时,直接从结果页进行批量导出——不要跳转到每个详情页。结果中的
exportId
与详情页的
#export-id
一致。使用批量模式调用
cnki-export
技能(步骤1B)。详情请查看cnki-export SKILL.md文档。

Tool calls: 2 (navigate + evaluate_script)

工具调用次数:2次(navigate + evaluate_script)