Extract content from local files or websites into structured JSON formats.

Install

mkdir -p .claude/skills/spider && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9602" && unzip -o skill.zip -d .claude/skills/spider && rm skill.zip

Installs to .claude/skills/spider

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Atomic reference for three spider flows: spider:extract:file, spider:extract:url, spider:zhihu — inputs, outputs, env vars only.
128 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Extract content from local UTF-8 files
  • Convert web pages to JSON
  • Scrape content from URLs
  • Process Zhihu question threads

How it works

It uses CLI flows to extract text from local files or web pages, outputting structured JSON objects.

Inputs & outputs

You give it
File path or URL
You get back
JSON object with title and content

When to use spider

  • Extract content from file
  • Scrape webpage text
  • Convert page to JSON

About this skill

Spider — 三种用法(输入 / 输出 / 环境变量)

monorepo 根目录执行(cwd 影响相对路径;DeepSeek 相关见仓库根 .env)。packages/spider/README.md 仅为路牌链回本文。


1. 本地 UTF-8 文件 → { title, content } JSON

用法

SPIDER_SOURCE=<相对或绝对路径> \
[SPIDER_OUTPUT_FILENAME=<文件名>] \
pnpm spider:extract:file

自定义输出目录(此时 SPIDER_OUTPUT_DIR 必填):

SPIDER_SOURCE=<路径> \
SPIDER_OUTPUT_DIR=<目录> \
[SPIDER_OUTPUT_FILENAME=<文件名>] \
pnpm exec tsx packages/spider/cli-extract-text-file-json.ts

输入

项目说明
SPIDER_SOURCE本地 UTF-8 文本/Markdown 等文件路径(相对 cwd
标题推导首条非空行为 # 标题 → 该行为 title、余下为 content;否则 title = 文件名去扩展名,content = 全文

输出

路径内容
<SPIDER_OUTPUT_DIR>/<SPIDER_OUTPUT_FILENAME>JSON:{ "title": string, "content": string }

pnpm spider:extract:file 通过脚本 固定 SPIDER_OUTPUT_DIR=output/spider。走 tsx …cli-extract-text-file-json.ts 时目录由你设定。

环境变量

变量必填默认值 / 说明
SPIDER_SOURCE文件路径
SPIDER_OUTPUT_DIRpnpm spider:extract:file 时不必设(脚本设为 output/spider);用 直接 tsx
SPIDER_OUTPUT_FILENAMEoutput.json

2. http(s) 页面 URL → { title, content } JSON(Puppeteer)

用法

SPIDER_SOURCE=<https://…> \
[SPIDER_OUTPUT_FILENAME=<文件名>] \
pnpm spider:extract:url

自定义输出目录:

SPIDER_SOURCE=<https://…> \
SPIDER_OUTPUT_DIR=<目录> \
[SPIDER_OUTPUT_FILENAME=<文件名>] \
pnpm exec tsx packages/spider/cli-extract-page-url-json.ts

输入

项目说明
SPIDER_SOURCE完整 URL,须以 http://https:// 开头

输出

路径内容
<SPIDER_OUTPUT_DIR>/<SPIDER_OUTPUT_FILENAME>JSON:{ "title": string, "content": string }(多回答会合并进 content

pnpm spider:extract:url 固定 SPIDER_OUTPUT_DIR=output/spider

环境变量

变量必填默认值 / 说明
SPIDER_SOURCE页面 URL
SPIDER_OUTPUT_DIR同「用法 1」
SPIDER_OUTPUT_FILENAMEoutput.json
PUPPETEER_EXECUTABLE_PATH自定义 Chromium
SPIDER_SAVE_DEBUG1 时在 SPIDER_OUTPUT_DIR(未设则包内默认 output/spider)下写调试 PNG/HTML

3. 知乎问题 URL → 结构化 JSON + 口播 + 标题同步

用法

pnpm spider:zhihu -- https://www.zhihu.com/question/<id>

或:

pnpm exec tsx packages/spider/zhihu/cli-zhihu-video-prep.ts https://www.zhihu.com/question/<id>

pnpm spider:zhihu 会设 SPIDER_OUTPUT_DIR=output/spider。)

输入

项目说明
第一个 CLI 参数知乎问题 URL,须匹配 https://www.zhihu.com/question/...

输出

路径内容
<SPIDER_OUTPUT_DIR>/output.json{ "title", "content", "answers": [...] }
<SPIDER_OUTPUT_DIR>/title.json{ "title": string }
public/video/title.json与上同内容的副本(供 Remotion)
getTtsInputFile() 解析路径(默认可为 <SPIDER_OUTPUT_DIR>/input.txt口播正文;由 caption-generator 写入,TTS_INPUT_FILE 可覆盖

口播生成失败时:output.json 等抓取结果仍可保留(仅控制台告警)。

环境变量

变量必填默认值 / 说明
SPIDER_OUTPUT_DIRpnpm spider:zhihu 设为 output/spider;直接 tsx 未设时包内默认 output/spider
DEEPSEEK_API_KEY口播需要环境变量或仓库根 .env
TTS_INPUT_FILE覆盖默认 input.txt 路径(caption-generator / getTtsInputFile()
PUPPETEER_EXECUTABLE_PATH自定义 Chromium
SPIDER_SAVE_DEBUG1 时写调试 PNG/HTML(目录规则同用法 2)

When not to use it

  • Non-textual data extraction

Prerequisites

DEEPSEEK_API_KEYPuppeteer

Limitations

  • Requires network access for URL extraction
  • Depends on Puppeteer for page rendering

How it compares

It provides atomic, automated extraction flows instead of manual scraping or parsing.

Compared to similar skills

spider side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
spider (this skill)04moReviewIntermediate
firecrawl-scrape57moReviewBeginner
batch-research16moNo flagsIntermediate
firecrawl03moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry