Files
crawl4zeroerr/1_零差云控官网爬虫方案.md

81 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 零差云控官网爬虫方案
## 项目概述
- **网页源**: https://www.zeroerr.cn/
- **目标**: 爬取官网所有子页面内容,生成 Markdown 和 Word 文档
- **用途**: 作为 RAGFlow 知识库,用于售前 AI 客服
## 代码结构
```
crawl_0131(1)/
├── main.py # 主入口
├── requirements.txt # 依赖
├── zeroerr_crawler/ # 爬虫模块
│ ├── __init__.py
│ ├── config.py # 配置文件(所有任务配置)
│ ├── base_crawler.py # 基础爬虫类
│ ├── product_crawler.py # 产品页专用爬虫(处理 eRob、eCoder、配件
│ ├── extract_abstract.py # 摘要提取模块(使用大模型生成文档摘要)
│ └── utils.py # 工具函数
└── output/ # 输出目录
```
## 爬取任务完成情况
| 任务 | 命令 | 篇数 | 状态 |
|------|------|------|------|
| 应用案例 | `python main.py case` | 14篇 | ✅ 完成 |
| 常见问题 | `python main.py issue` | 32篇 | ✅ 完成 |
| 企业新闻 | `python main.py news` | 11篇 | ✅ 完成 |
| 认证与资质 | `python main.py certification` | 10篇 | ✅ 完成 |
| 机器人关节 | `python main.py erob` | 12篇 | ✅ 完成 |
| 编码器 | `python main.py ecoder` | 7篇 | ✅ 完成 |
| 配件 | `python main.py tools` | 13篇 | ✅ 完成 |
| 关于我们 | `python main.py about` | 2篇 | ✅ 完成 |
| 服务与支持 | `python main.py support` | 1篇 | ✅ 完成 |
| 服务与支持-详细页面 | `python main.py service_detail` | 7篇 | ✅ 完成 |
| 资料下载 | `python main.py download` | 1篇 | ✅ 完成 |
**总计: 110 篇文章**
> 注:服务与支持和服务与支持-详细页面合并输出到同一个目录 `output/服务与支持/`
## 使用方法
```bash
# 安装依赖
pip install -r requirements.txt
# 查看所有可用任务
python main.py --list
# 爬取单个任务
python main.py case
# 爬取多个任务
python main.py case issue news
# 爬取全部
python main.py
```
## 输出格式
- 每个分类生成一个汇总文档(`xxx_汇总.md``xxx_汇总.docx`
- 图片保存到对应分类的 `images/` 目录
- Word 文档中嵌入本地图片
- 支持表格、列表、标题等格式转换
## 技术说明
- 使用 `StandardCrawler` 处理标准页面(新闻、案例、问题等)
- 使用 `ProductCrawler` 处理产品页面(机器人关节、编码器、配件)
- 支持多种页面布局和内容选择器
- 自动去重标题,优化 Word 文档格式
- **摘要提取**`extract_abstract.py` 模块使用大模型OpenAI API为每个分类的文档集合生成摘要
- 面向客户售前咨询场景生成100-200字的简洁摘要
- 自动生成相关链接列表
- 摘要失败时自动降级为仅生成链接列表
## 待处理项目
- [ ] 报价与交期页面https://www.zeroerr.cn/inquiry/
- [ ] 快速交货与货期https://www.zeroerr.cn/stock/109.html