course-scraper

course-scraper is a skill for Claude Code, Codex from chengkj99/kj-skills. It costs 244 tokens per session (3,892 once invoked), scanned A, original, MIT.

A course and webpage scraper that saves text and images as structured Markdown files. It can work through a logged-in course platform such as Skilljar or follow a supplied list of links, with optional Chinese-English translation.

In plain words
What is it for?
Use it to archive course lessons or linked webpages, download relevant images beside each document, preserve their position in the text, and create bilingual notes when needed.
Why use it?
It turns scattered online lessons into readable local archives and avoids losing screenshots, diagrams, and other images from the original material.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present. Also seen: mentions Claude Code.

Part of the kj-skills plugin — 34 skills, 1 command, 1 hook shipped together

Good fit Use it to archive course lessons or linked webpages, download relevant images beside each document, preserve their position in the text, and create bilingual notes when needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chengkj99/kj-skills/course-scraper
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add chengkj99/kj-skills --skill course-scraper
Clone the repo
git clone --depth 1 https://github.com/chengkj99/kj-skills

Made for: Claude Code, Codex.

Or install kj-skills, the plugin that ships this one along with the rest of its 34 skills, 1 command, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for course-scraper

README.md
[![agentmods](https://agentmods.dev/badge/skills/chengkj99/kj-skills/course-scraper/github.svg)](https://agentmods.dev/skills/chengkj99/kj-skills/course-scraper)
Your own site
<a href="https://agentmods.dev/skills/chengkj99/kj-skills/course-scraper"><img src="https://agentmods.dev/badge/skills/chengkj99/kj-skills/course-scraper/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for course-scraper

Your own site · 80×15
<a href="https://agentmods.dev/skills/chengkj99/kj-skills/course-scraper"><img src="https://agentmods.dev/badge/skills/chengkj99/kj-skills/course-scraper.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 244 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,892 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00244 $0.03892
Opus 5 $0.00122 $0.01946
Sonnet 5 $0.00049 $0.00778
Haiku 4.5 $0.00024 $0.00389

Measured 11d ago against content hash 92bac94714e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

course-scraper scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/fetch_links.py, scripts/scrape.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/course-scraper/SKILL.md · 267 lines

How it starts

The opening of the file, as written. The whole thing — 267 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Course Scraper — 课程抓取 & 双语翻译

从在线课程平台抓取所有课时文字内容与图片,存为结构化 Markdown,并翻译成中英对照格式。


适用场景

  • 用户提供一个课程 URL(如 Skilljar、LMS 类平台),想把内容本地存档 → 单课程平台模式
  • 用户提供一份链接清单/导航页/资源合集(几十条跨域链接),想把这些链接的正文都抓下来 → 链接清单模式
  • 需要将英文内容翻译成中英双语对照版本
  • 课程需要账号登录才能访问
  • 需要把网页/PDF/课程里的图片一并本地归档,避免 Markdown 依赖远程图片

图片抓取规则(默认开启)

两个脚本都必须把图片作为正文资产的一部分处理:

  • 图片保存位置:每篇文章/课时旁边的 _assets/<文件slug>/
  • Markdown 写法:正文里的远程图片链接改成本地相对路径,例如 ![](./_assets/xx/01-image.png)![](_assets/xx/01-image.png)
  • 图片必须尽量插回正文原位置:优先在正文容器内按 DOM 顺序转换 Markdown,让图出现在对应段落/步骤附近,形成可读的图文资料。
  • 只有当正文提取器无法保留图片位置时,才允许在文末追加 ## 图片 / Images 区块;这种情况必须在报告或文件头体现,方便后续人工复核。
  • 文件头或报告中记录图片数量:图片 / Images: 已下载数/候选数
  • 跳过 data:blob:、明显小图标、头像、二维码、评论区、页脚分享图等非正文图片;下载失败不阻塞正文抓取,但必须在报告中体现下载数量。
  • 下载图片后必须校验响应类型,text/html / 验证页 / 错误页不能冒充图片落盘;若下载失败,保留正文并在报告中记录。

经验教训:早期版本只抓正文,scrape.py 甚至只取 inner_text(),会把课程截图、流程图、UI 图全部丢掉。后续任何抓取都要把“图片本地化”作为验收项。 经验教训:很多站点会把头像、二维码、作者卡片、评论区、推荐阅读、分享按钮、广告和页脚混在 body 里。抓取时必须优先锁定正文容器(如 articlemain[role=main].markdown-body.post-content.lesson-content,以及少数站点的正文容器如 #js_content),不要从 body img 全量收图。

正文清洗规则(默认开启)

抓取目标不是“整页备份”,而是“可阅读、可沉淀的正文资料”。脚本输出必须满足:

  • 优先选择通用正文容器:articlemain[role=main].markdown-body.post-content.entry-content.article-content.lesson-content 等;站点特定容器(如 #js_content)只能作为补充选择器,不能让脚本退化为某个平台专用。
  • 不要把导航栏、页脚、作者卡片、二维码、评论/留言入口、分享按钮、推荐阅读、订阅/登录 CTA、搜索/投诉/跳转提示、登录运行时提示当作正文。
  • trafilatura 抽取结果偏薄或混入运行时文案,必须回到 Playwright DOM,读取正文容器并二次清洗。
  • 文件头里的 抓取方式 要写明使用了 dom-container:<selector>trafilatura 还是 markdownify-fallback,不要把兜底产物伪装成高质量正文。
  • 如果正文和图片位置明显错位,优先修脚本或做容器级重抓;不要只把图片堆到文末交付。
  • 如果输出里出现验证码、安全验证、异常环境页、security verification,或 markdownify-fallback 产物包含大量 CSS/JS(如 window.document.@media),即使字符数很多也必须标为 THIN/ERROR,不能算 OK

先判别模式(最重要)

拿到需求后,第一步判断属于哪种模式,不要默认套单课程逻辑:

信号 模式 用哪个脚本
一个课程站点、登录后有侧边栏课时列表(Skilljar/LMS) 单课程平台模式 scripts/scrape.py
一份 Markdown/文档里列了许多不同域名的链接(资源清单、导航页、合集) 链接清单模式 scripts/fetch_links.py

Read the full file on GitHub · 267 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 267 lines · 244 tokens per session scan A 92bac94714e6

Subscribe to this mod's changes

course-scraper is a skill published in the GitHub repository chengkj99/kj-skills (14 stars, last pushed 10d ago), licensed MIT. It adds 244 tokens to every session and 3,892 once invoked, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

baoyu-youtube-transcript

A tool for downloading the written captions, subtitles, chapter information, speaker labels, and cover image from a YouTube video using its URL or ID.

JimLiu/baoyu-skills · 107 tokens

orbit-notion

Open Orbit briefing skill — selected by the Orbit pipeline when Notion is the user's only connected connector, or when the user explicitly scopes their daily digest to Notion. Pulls the past 24 hours of document edits, comments, mentions, and database row changes from the user's authenticated Notion connection and…

nexu-io/open-design · 117 tokens

instrument-data-to-allotrope

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…

anthropics/knowledge-work-plugins · 123 tokens

feishu

Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.

Hmbown/CodeWhale · 33 tokens

read

Reads URLs and PDFs by fetching source content, defaulting to concise summaries for plain read requests and clean Markdown when asked to convert, save, quote, cite, or feed downstream work. Use when users ask in any language to read, fetch, check, summarize, quote, cite, convert, or save a URL or PDF. Not for local…

tw93/Waza · 78 tokens

overleaf-sync

A two-way connection between a local paper folder and Overleaf, a web-based LaTeX editor for writing research papers. It lets you move changes between the local files and the shared Overleaf project.

wanshuiyin/Auto-claude-code-research-in-sleep · 97 tokens