Fetch and save web content using only Python stdlib with URL and path validation, basic HTML-to-markdown conversion, and no API keys or external dependencies.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install url-fetcher或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install url-fetcher⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/url-fetcher/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: url-fetcher description: Simple web content fetching without API keys or external dependencies. Uses Python stdlib (urllib) only. Features: fetch HTML/text from URLs, basic HTML to markdown conversion, path-validated file writes (blocks system paths), URL validation (blocks localhost/internal). Security: File writes use is_safe_path() to prevent malicious writes. Perfect for content aggregation, research collection, and web scraping without API costs or dependencies. ---
Fetch web content without API keys or external dependencies. Uses Python standard library only.
url_fetcher.py fetch <url>
url_fetcher.py fetch --markdown <url> [output_file]
Examples:
# Fetch and preview
url_fetcher.py fetch https://example.com
# Fetch and save HTML
url_fetcher.py fetch https://example.com ~/workspace/page.html
# Fetch and convert to basic markdown
url_fetcher.py fetch --markdown https://example.com ~/workspace/page.md
# Fetch multiple articles
url_fetcher.py fetch https://example.com/article1.md ~/workspace/research/article1.md
url_fetcher.py fetch https://example.com/article2.md ~/workspace/research/article2.md
# Convert to markdown for reading
url_fetcher.py fetch --markdown https://example.com/article.md ~/workspace/research/article.md
# Fetch pages for processing
url_fetcher.py fetch https://news.example.com ~/workspace/content/latest.html
# Extract text
url_fetcher.py fetch --markdown https://blog.example.com ~/workspace/content/post.md
# Just preview content (no file save)
url_fetcher.py fetch https://example.com
#!/bin/bash
# batch_fetch.sh
URLS=(
"https://example.com/page1"
"https://example.com/page2"
"https://example.com/page3"
)
OUTPUT_DIR="$HOME/workspace/fetched"
mkdir -p "$OUTPUT_DIR"
for url in "${URLS[@]}"; do
filename=$(echo $url | sed 's|/||g')
url_fetcher.py fetch --markdown "$url" "$OUTPUT_DIR/$filename.md"
sleep 1 # Be nice to servers
done
Combine with research-assistant:
# Fetch article
url_fetcher.py fetch --markdown https://example.com/article.md ~/workspace/article.md
# Extract key points
# Then use research-assistant to organize findings
Combine with task-runner:
# Add task to fetch content
task_runner.py add "Fetch article on topic X" "research"
# Fetch when ready
url_fetcher.py fetch https://example.com/topic-x.md ~/workspace/research/topic-x.md
Error: Request timeout after 10s
Solution: The server is slow or unreachable. Try again later or check the URL.
Error: HTTP 403: Forbidden
Solution: The site blocks automated requests. Try:
Error with special characters
Solution: The tool uses UTF-8 with error-ignore. Some characters may be lost.
Note: Basic markdown extraction
Solution: This tool uses simple regex for HTML→MD conversion. For better results:
from pathlib import Path
import subprocess
def fetch_and_process(url):
"""Fetch URL and process"""
output = Path.home() / "workspace" / "fetched" / "page.md"
output.parent.mkdir(parents=True, exist_ok=True)
# Fetch
subprocess.run([
"python3",
"/path/to/url_fetcher.py",
"fetch",
"--markdown",
url,
str(output)
])
# Process content
content = output.read_text()
return content
# Function for fetching
fetch_content() {
local url="$1"
local output="$2"
python3 ~/workspace/skills/url-fetcher/scripts/url_fetcher.py \
fetch --markdown "$url" "$output"
}
# Usage
fetch_content "https://example.com" ~/workspace/example.md
For full-featured scraping:
requests + beautifulsoup4 (requires pip install)scrapy framework (requires pip install)For better markdown:
markdownify library (requires pip install)For complex workflows:
This skill requires:
Perfect for autonomous agents with budget constraints.
If you improve this skill, please:
Use freely in your OpenClaw skills and workflows.
安装 URL Fetcher 后,可以对 AI 说这些话来触发它
Help me get started with URL Fetcher
Explains what URL Fetcher does, walks through the setup, and runs a quick demo based on your current project
Use URL Fetcher to fetch and save web content using only Python stdlib with URL and pa...
Invokes URL Fetcher with the right parameters and returns the result directly in the conversation
What can I do with URL Fetcher in my developer & devops workflow?
Lists the top use cases for URL Fetcher, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/url-fetcher/ 目录(个人级,所有项目可用),或 .claude/skills/url-fetcher/(项目级)。重启 AI 客户端后,用 /url-fetcher 主动调用,或让 AI 根据上下文自动发现并使用。
URL Fetcher 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
URL Fetcher 可免费安装使用。请查阅仓库了解许可证信息。
Fetch and save web content using only Python stdlib with URL and path validation, basic HTML-to-markdown conversion, and no API keys or external dependencies.
URL Fetcher 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using URL Fetcher
Identifies repetitive steps in your workflow and sets up URL Fetcher to handle them automatically