
web-content-fetcher
Expert guidance for fetching and parsing web content from URLs, handling various content sizes, JavaScript-rendered sites, and working around tool limitations. Use when fetching articles, documentation, social media posts, or any web content for translation, analysis, or archiving.
- Installs
- 70
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/shino369/claude-code-personal-workspace --skill web-content-fetcher- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads web-content-fetcher automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Web Content Fetcher
Expert knowledge for fetching and parsing web content, handling size limitations, JavaScript-rendered sites, and extracting clean article content from HTML.
Overview
This skill provides battle-tested strategies for fetching web content in Claude Code, addressing critical challenges:
- WebFetch tool limitation: ~50KB max content size
- Read tool limitation: 256KB max file size per call
- JavaScript-rendered content: Twitter/X, React SPAs require special handling
Four-tier approach:
- Tier 1: WebFetch for small content (< 50KB)
- Tier 2: curl + Task agent for any size static content ⭐ DEFAULT
- Tier 3: Scripts for edge cases (EUC-JP encoding, complex HTML)
- Tier 4: Playwright for JavaScript-rendered sites (Twitter/X, React SPAs)
Quick Tool Limitations
| Tool | Max Size | Best For | Limitation |
|---|---|---|---|
| WebFetch | ~50KB | Small articles, first attempt | Prompt length constraints |
| Read | 256KB | Reading fetched files | Large files need pagination |
| curl | Unlimited | Any size content, raw downloads | No parsing |
| Task agent | Unlimited | Extraction from any size HTML | Handles pagination automatically |
Tiered Fetching Strategy
Tier 1: Small Content - WebFetch Direct
Use when: Simple articles, API responses, first attempt on unknown content
Quick example:
WebFetch tool with url and extraction prompt
If fails: "Prompt too long" error → Switch to Tier 2
Tier 2: Any Size Content - curl + Task Agent ⭐ RECOMMENDED
Use when: News articles, blog posts, WebFetch fails, any content of any size
Quick workflow:
# 1. Create directory
mkdir -p output/tasks/YYYYMMDD_taskname/original
# 2. Fetch HTML
curl -s "URL" > output/tasks/YYYYMMDD_taskname/original/raw_html.html
# 3. Extract with Task agent
# Prompt: "Read HTML at [path], extract article content, save to fetched_content.md"
Why default: Handles any size, AI-powered extraction, no script setup needed.
For detailed workflow: See references/workflows.md
Tier 3: Script-Based Extraction - Edge Cases Only
Use when: Task agent struggles with complex HTML or special encoding requirements (EUC-JP)
Available scripts:
scripts/extract_article.js- Standard HTML with Mozilla Readabilityscripts/extract_eucjp.js- Japanese EUC-JP encoded sites (4gamer.net)
Quick example:
node .claude/skills/web-content-fetcher/scripts/extract_article.js raw_html.html > fetched_content.md
Note: Try Task agent (Tier 2) first. Scripts only when Task agent explicitly fails.
For script details: See references/advanced-fetching.md
Tier 4: JavaScript-Rendered Content - Playwright
Use when: Twitter/X, React SPAs, dynamic sites, static fetch returns empty/error
Quick example:
node .claude/skills/web-content-fetcher/scripts/fetch_js_content.js \
"https://x.com/user/status/123456789" \
--output fetched_content.md
Common sites: Twitter/X, Threads, Instagram, React/Vue/Angular SPAs, AJAX-loaded content
Image Extraction:
- Automatically extracts images if exist (Twitter/X, Threads, blogs, etc.)
- Captures image URLs with alt text from main content area
- Filters out small images (icons/logos) automatically
- Output includes structured Media section with URLs for downloading
Setup required (one-time):
cd .claude/skills/web-content-fetcher
pnpm add -D playwright --save-catalog-name=dev
pnpm exec playwright install chromium
For Playwright details: See references/advanced-fetching.md
Decision Tree
Use this flowchart to choose the right approach:
Need to fetch web content?
│
├─ JavaScript-rendered site (Twitter/X, React SPA, dynamic content)?
│ └─ Use Playwright script (Tier 4)
│ └─ See: references/advanced-fetching.md
│
├─ Size unknown or small expected content?
│ └─ Try WebFetch (Tier 1)
│ ├─ Success? → Done ✓
│ └─ "Prompt too long" error? → Use Tier 2
│
├─ Any other case (medium/large content, WebFetch failed)?
│ └─ Use curl + Task agent (Tier 2) ⭐ DEFAULT
│ ├─ Success? → Done ✓
│ └─ Task agent struggles? → Use Tier 3
│ └─ See: references/advanced-fetching.md
│
└─ Edge cases (Task agent fails, special encoding)?
└─ Use curl + script (Tier 3)
└─ See: references/advanced-fetching.md
Standard Workflow Quick Reference
Most common pattern (works for 90% of cases):
# 1. Setup
mkdir -p output/tasks/20260111_taskname/original
# 2. Fetch
curl -s "URL" > output/tasks/20260111_taskname/original/raw_html.html
# 3. Extract (Task agent prompt)
"Read HTML file at [path], extract main article content,
remove navigation/ads/sidebars/comments/footer,
save clean markdown to: [path]/fetched_content.md"
# 4. Use
Read: output/tasks/20260111_taskname/original/fetched_content.md
For detailed workflows and patterns: See references/workflows.md
Common Use Cases
Translation with images:
- Fetch content (Tier 2 or Tier 4 for JS sites)
- Extract to
original/fetched_content.mdwith readable format (includes Media section with image URLs) - Download images using URLs from Media section
- Pass to
/translatecommand
Analysis:
- Fetch content (Tier 2 or Tier 4)
- Extract to
original/fetched_content.mdwith readable format - Read and analyze
Social media posts (Twitter/X, Threads, Instagram):
- Use Playwright (Tier 4) directly
- Automatically extracts text, images, and metadata
- Outputs to
fetched_content.mdwith Media section in a readable format - Download images from extracted URLs
- Use for translation/analysis
For all patterns: See references/workflows.md
When Things Go Wrong
Common issues and quick fixes:
| Issue | Quick Fix | Details |
|---|---|---|
| WebFetch "Prompt too long" | Switch to Tier 2 | troubleshooting.md |
| Read tool file too large | Use Task agent | troubleshooting.md |
| Garbled Japanese text | EUC-JP encoding issue | troubleshooting.md |
| JavaScript required | Use Playwright (Tier 4) | troubleshooting.md |
| Anti-bot protection | Add user agent | troubleshooting.md |
| Authentication required | Use curl with headers/cookies | troubleshooting.md |
For complete troubleshooting guide: See references/troubleshooting.md
Best Practices
- Always use task directories:
output/tasks/YYYYMMDD_taskname/ - Default to Tier 2: curl + Task agent works for nearly all cases
- Keep raw HTML: Save to
original/raw_html.htmlfor reference (except Tier 4) - Use Playwright for JS sites: Twitter/X, React SPAs, dynamic content
- Clean content format: Always save extracted content as markdown
- Descriptive naming: Use date prefix (
YYYYMMDD_) and descriptive task names - Try simple first: WebFetch → curl + Task agent → Scripts (only if needed)
- Task agent for extraction: Let AI handle pagination and parsing complexity
Reference Files
This skill uses progressive disclosure for efficiency. Core information is in this file. Detailed guides are in reference files:
- references/workflows.md - Standard workflows, common patterns, directory structure, content extraction priorities
- references/advanced-fetching.md - Tier 3 script-based extraction, Tier 4 Playwright details, setup instructions
- references/troubleshooting.md - Common issues, solutions, quick reference commands
Read reference files when you need detailed guidance for specific scenarios.
Quick Start Examples
Simple article:
mkdir -p output/tasks/20260111_article/original
curl -s "https://example.com/article" > output/tasks/20260111_article/original/raw_html.html
# Task agent: Extract to fetched_content.md
Twitter/X post:
mkdir -p output/tasks/20260111_twitter/original
node .claude/skills/web-content-fetcher/scripts/fetch_js_content.js \
"https://x.com/user/status/123" \
--output output/tasks/20260111_twitter/original/fetched_content.md
Threads post:
mkdir -p output/tasks/20260111_threads/original
node .claude/skills/web-content-fetcher/scripts/fetch_js_content.js \
"https://www.threads.com/@user/post/ABC123" \
--output output/tasks/20260111_threads/original/fetched_content.md
Output format with images (works for all sites):
# Title
Main content text here...
### Media
1. Image description or alt text
- URL: https://example.com/image1.jpg
2. Another image
- URL: https://example.com/image2.jpg
Note:
- Images are automatically extracted from the main content area
- Small images (< 100x100px) like icons/logos are filtered out
- Image formats:
.jpg,.png,.webp,.gif,.svg- all preserved in URLs - When downloading, respect the original file extension
Japanese site (potential encoding issue):
mkdir -p output/tasks/20260111_japanese/original
curl -s "https://4gamer.net/..." > output/tasks/20260111_japanese/original/raw_html.html
# Task agent with encoding detection, or use extract_eucjp.js if needed
FAQ
What does the web-content-fetcher skill do?
Expert guidance for fetching and parsing web content from URLs, handling various content sizes, JavaScript-rendered sites, and working around tool limitations. Use when fetching articles, documentation, social media posts, or any web content for translation, analysis, or archiving.
How do I install web-content-fetcher?
Run npx skills add https://github.com/shino369/claude-code-personal-workspace --skill web-content-fetcher in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/web-content-fetcher/ (personal) or .claude/skills/web-content-fetcher/ (project).
Which AI agents can use web-content-fetcher?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is web-content-fetcher safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains web-content-fetcher?
It is published by shino369 in shino369/claude-code-personal-workspace. It has 70 recorded installs.
More from shino369/claude-code-personal-workspace
translation-expertise
shino369/claude-code-personal-workspace
Expert translation methodology and best practices for English-Japanese-Chinese (Traditional) trilingual translation. Use when translating any content between these languages, including handling idioms, cultural nuances, and language-specific expressions. Provides translation workflows and quality assurance methods.
document-writing
shino369/claude-code-personal-workspace
Expert knowledge in document and essay writing conventions for English, Japanese, and Chinese (Traditional). Use when writing or translating formal documents, essays, articles, reports, or professional communications. Provides language-specific writing styles, formatting conventions, and rhetorical patterns.
engineering-terminology
shino369/claude-code-personal-workspace
Expert knowledge in engineering, technical, and scientific terminology across English, Japanese, and Chinese (Traditional). Use when translating technical documents, engineering specifications, API documentation, or scientific papers. Provides accurate technical term translations and domain-specific vocabulary.
Popular docs & writing skills
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
lark-markdown
open.feishu.cn
飞书 Markdown:查看、创建、上传、编辑和比较飞书中的原生 Markdown 文件。当用户要操作飞书 Markdown 文件,或比较其远端版本及本地草稿时使用。纯本地 Markdown 文件操作不触发本 skill。不负责将 Markdown 导入为飞书在线文档,也不负责文件搜索、权限、评论、移动、删除等云空间管理操作。
writing-beats
mattpocock/skills
Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.
writing-shape
mattpocock/skills
Writing, exploit: shape raw material into an article, paragraph by paragraph.
writing-fragments
mattpocock/skills
Writing, explore: mine raw fragments, no structure yet.
writing-for-agents
mattpocock/skills
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.