
Cnki Download
- 635 installs
- 811 repo stars
- Updated March 13, 2026
- cookjohn/cnki-skills
cnki-download is a Claude Code skill that downloads full-text CNKI academic papers as PDF or CAJ files for developers who need automated literature retrieval while already authenticated to CNKI.
About
cnki-download is a skill from cookjohn/cnki-skills that automates downloading full-text academic papers from CNKI (China National Knowledge Infrastructure). It accepts an optional paper detail URL or uses the current browser page, navigates with navigate_page instead of click-based tab opens, and retrieves PDF or CAJ files when the user is logged in with download permissions. Developers reach for cnki-download when building research agents or literature review workflows that must fetch CNKI papers without manual login navigation and extra tab management.
- Downloads PDF or CAJ format papers from CNKI
- Works from either a direct paper URL or current detail page
- Single async evaluate_script for status check and download
- Built-in captcha detection with clear user guidance
- Avoids wasteful new-tab navigation patterns
Cnki Download by the numbers
- 635 all-time installs (skills.sh)
- Ranked #1,523 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cookjohn/cnki-skills --skill cnki-downloadAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 635 |
|---|---|
| repo stars | ★ 811 |
| Last updated | March 13, 2026 |
| Repository | cookjohn/cnki-skills ↗ |
How do you download full-text papers from CNKI automatically?
Instantly fetch full-text academic papers from CNKI without manual login navigation or extra tab management.
Who is it for?
Developers automating CNKI literature downloads who already have an authenticated CNKI account with download rights.
Skip if: Users without CNKI login and download permissions or teams needing non-CNKI academic sources.
When should I use this skill?
A developer requests downloading a specific CNKI paper or is already on a CNKI detail page needing PDF or CAJ retrieval.
What you get
Downloaded CNKI paper files in PDF or CAJ format saved from an authenticated session without extra browser tabs.
- Downloaded PDF or CAJ paper file
Files
CNKI Paper Download (文献下载)
Prerequisites
User must be logged in to CNKI with download permissions.
Arguments
$ARGUMENTS is optionally a paper detail URL. If blank, uses current page.
Steps
1. Navigate (if URL provided)
If URL provided: use navigate_page to go to the URL directly (no wait_for needed — Step 2 handles waiting).
Important: Always use navigate_page instead of clicking links on the search results page. Clicking opens a new tab and wastes 3 extra tool calls (list_pages + select_page + take_snapshot).
2. Check status and download (single async evaluate_script)
Replace FORMAT with "pdf" or "caj":
async () => {
// Wait for page load
await new Promise((r, j) => {
let n = 0;
const c = () => {
if (document.querySelector('.brief h1')) r();
else if (++n > 30) j('timeout');
else setTimeout(c, 500);
};
c();
});
// Captcha check
const cap = document.querySelector('#tcaptcha_transform_dy');
if (cap && cap.getBoundingClientRect().top >= 0) {
return { error: 'captcha', message: 'CNKI 正在显示滑块验证码。请在 Chrome 中手动完成拼图验证。' };
}
const format = "FORMAT"; // "pdf" or "caj"
// Check download links
const pdfLink = document.querySelector('#pdfDown') || document.querySelector('.btn-dlpdf a');
const cajLink = document.querySelector('#cajDown') || document.querySelector('.btn-dlcaj a');
// Check login status
const notLogged = document.querySelector('.downloadlink.icon-notlogged')
|| document.querySelector('[class*="notlogged"]');
if (notLogged) {
return { error: 'not_logged_in', message: '下载需要登录。请先在 Chrome 中登录知网账号。' };
}
const title = document.querySelector('.brief h1')?.innerText?.trim()?.replace(/\s*网络首发\s*$/, '') || '';
if (format === 'pdf' && pdfLink) {
pdfLink.click();
return { status: 'downloading', format: 'PDF', title };
} else if (format === 'caj' && cajLink) {
cajLink.click();
return { status: 'downloading', format: 'CAJ', title };
} else if (pdfLink) {
pdfLink.click();
return { status: 'downloading', format: 'PDF', title };
} else if (cajLink) {
cajLink.click();
return { status: 'downloading', format: 'CAJ', title };
}
return { error: 'no_download', message: '未找到下载链接', hasPDF: !!pdfLink, hasCAJ: !!cajLink };
}3. Report
Based on JS result:
status: downloading→ "PDF 下载已触发:{title}。请在 Chrome 下载管理器中查看。"error: not_logged_in→ tell user to log inerror: captcha→ tell user to solve captcha
Tool calls: 1–2 (navigate_page if URL + evaluate_script)
Verified selectors
| Element | Selector | Notes |
|---|---|---|
| PDF download | #pdfDown | <a> inside li.btn-dlpdf |
| CAJ download | #cajDown | <a> inside li.btn-dlcaj |
| Download area | .download-btns | parent <div> |
| Not logged in | .downloadlink.icon-notlogged | |
| Title | .brief h1 | strip trailing "网络首发" |
Captcha detection
Check #tcaptcha_transform_dy element's getBoundingClientRect().top >= 0. Only active when top >= 0 (visible). Pre-loaded SDK sits at top: -1000000px.
Related skills
How it compares
Pick cnki-download for authenticated CNKI browser retrieval; use general web-scraping skills only when CNKI-specific navigation rules do not apply.
FAQ
What file formats does cnki-download retrieve?
cnki-download retrieves CNKI papers as PDF or CAJ files from a detail page URL or the current browser page. The cookjohn/cnki-skills workflow uses navigate_page and requires the user to be logged into CNKI with download permissions.
Does cnki-download require CNKI login?
cnki-download requires an authenticated CNKI session with download permissions before retrieval runs. The skill automates navigation and download steps but does not bypass CNKI access controls or institutional licensing.