Evine:一款功能强大的交互式命令行Web爬虫
字数 1337 2025-08-15 21:31:40
Evine 交互式命令行 Web 爬虫使用教程
1. 工具概述
Evine 是一款基于 Golang 开发的功能强大的交互式命令行 Web 爬虫,具有以下特点:
- 简单快速的交互式操作界面
- 支持元数据和其他数据的提取
- 可用于数据挖掘、网络侦察和测试任务
- 支持大范围扫描任务
2. 安装要求
- 系统要求:需要 Golang 1.13.x 环境
- 安装选项:
- 预构建源码:从 GitHub Release 页面获取
- 源码安装
- GitHub 库安装
3. 安装方法
3.1 源码安装
go get github.com/saeeddhqan/evine
"$GOPATH/bin/evine" -h
3.2 GitHub 库安装
git clone https://github.com/saeeddhqan/evine.git
cd evine
go build .
mv evine /usr/local/bin
evine --help
4. 交互式快捷键
| 快捷键 | 功能描述 |
|---|---|
| Enter | 运行爬虫(URL视图)或显示响应信息 |
| Tab | 切换下一个视图 |
| Ctrl+Space | 运行爬虫 |
| Ctrl+S | 保存响应信息 |
| Ctrl+Z | 工具退出 |
| Ctrl+R | 回复默认值 |
| Ctrl+Q | 关闭响应存储视图 |
5. 命令行参数详解
5.1 基本参数
-h:显示帮助信息-url:指定待爬取的URL地址evine -url toscrape.com
5.2 排除过滤参数
-url-exclude string:通过正则表达式排除匹配的URLevine -url-exclude ?id=-domain-exclude string:排除指定域名(逗号分隔,默认为root域名)evine -domain-exclude host1.tld,host2.tld-code-exclude string:排除指定HTTP状态码(竖线分隔,默认为".*")evine -code-exclude 200,201
5.3 爬取控制参数
-delay int:设置请求间休眠时间(毫秒)evine -delay 300-depth:指定爬虫搜索深度(默认为1)evine -depth 2-thread int:指定并发线程数(默认为5)evine -thread 10
5.4 请求配置参数
-header:设置请求的HTTP Headerevine -header KEY: VALUE\nKEY1: VALUE1-proxy string:指定代理地址evine -proxy http://1.1.1.1:8080-scheme string:设置请求发送模式evine -scheme http-timeout int:指定超时时间(秒,默认为10)evine -timeout 15
5.5 内容搜索参数
-keys string:指定搜索内容类型
支持的类型包括:邮件、URL、电话、css、cdn、dns、脚本或文件后缀等evine -keys urls,pdf,txt-regex string:针对页面内容指定搜索正则式evine -regex 'User.+'-max-regex int:指定正则搜索的最大结果数量(默认为1000)evine -max-regex -1
5.6 种子源参数
-robots:将目标URL的robots.txt作为种子evine -robots-sitemap:将目标URL的sitemap.xml作为种子evine -sitemap
6. 使用示例
6.1 基本爬取
evine -url example.com -depth 2 -thread 10
6.2 排除特定内容
evine -url example.com -url-exclude \.jpg$ -domain-exclude cdn.example.com
6.3 高级搜索
evine -url example.com -keys emails,phones,pdf -regex 'admin_.+'
6.4 使用代理和自定义Header
evine -url example.com -proxy http://127.0.0.1:8080 -header "User-Agent: CustomAgent\nAuthorization: Bearer token123"
7. 注意事项
- 确保使用 Golang 1.13.x 环境
- 大规模扫描时注意设置合理的
-delay参数以避免被封禁 - 使用
-thread参数时考虑系统资源限制 - 正则表达式搜索可能会消耗大量资源,合理设置
-max-regex参数 - 使用
-robots和-sitemap参数可以获取更全面的爬取起点
8. 工具截图与演示
(注:原文提到有工具运行截图和演示视频,实际使用时可以参考GitHub仓库中的相关资源)