web-crawler
Skill1 starsChanged 5 months agoMITView on GitHub
基于requests和BeautifulSoup的网页爬虫skill,支持抓取网页内容、提取链接、下载图片等功能
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Starchild-ai-agent/official-skillstheir own version, first seen May 21, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Starchild-ai-agent/official-skills★ 27same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- batch_renamerSkill
- data_processorSkill
- directory_treeSkill
- ffmpeg_processorSkill
- file_comparatorSkill
- file_organizerSkill
- image_downloaderSkill
- image_processorSkill
- password_generatorSkill
- pdf_toolSkill
- pdf-word-converterSkill
- sftp_toolSkill
- wechat_image_downloaderSkill
The file
Files
Web Crawler Skill
一个功能强大的网页爬虫工具,基于requests和BeautifulSoup4构建。
功能特性
- 抓取网页HTML内容
- 提取页面中的所有链接
- 下载图片到本地
- 提取页面文本内容
- CSS选择器支持
- 自动处理编码
- 支持自定义请求头
使用方法
基础使用
from claude_skills.web_crawler import WebCrawler
# 创建爬虫实例
crawler = WebCrawler()
# 抓取网页
html = crawler.fetch("https://example.com")
# 提取所有链接
links = crawler.extract_links(html)
# 下载图片
crawler.download_image("https://example.com/image.jpg", "output/image.jpg")
# 使用CSS选择器提取内容
titles = crawler.select(html, "h1.title")高级配置
# 自定义请求头
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
}
crawler = WebCrawler(headers=headers, timeout=30)API 参考
WebCrawler类
__init__(headers=None, timeout=10)
初始化爬虫实例。
参数:
headers(dict, optional): 自定义HTTP请求头timeout(int, optional): 请求超时时间(秒)
fetch(url, params=None)
获取网页HTML内容。
参数:
url(str): 目标URLparams(dict, optional): URL查询参数
返回:
str: HTML内容
extract_links(html, base_url=None)
从HTML中提取所有链接。
参数:
html(str): HTML内容base_url(str, optional): 基础URL,用于补全相对链接
返回:
list: 链接列表
extract_text(html)
从HTML中提取纯文本内容。
参数:
html(str): HTML内容
返回:
str: 纯文本内容
select(html, selector)
使用CSS选择器提取元素。
参数:
html(str): HTML内容selector(str): CSS选择器
返回:
list: 匹配的元素文本列表
download_image(url, save_path)
下载图片到本地。
参数:
url(str): 图片URLsave_path(str): 保存路径
get_soup(html)
获取BeautifulSoup对象,进行更复杂的解析。
参数:
html(str): HTML内容
返回:
BeautifulSoup: Soup对象
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

