Releases: andeya/pholcus
Releases · andeya/pholcus
v1.4.0
1. 代码现代化与注释英文化 (3d1faf8)
- 全量中文注释翻译为地道英文,为导出符号添加 Go doc 注释
strings.Replace(..., -1)统一替换为strings.ReplaceAll- 用 Go 标准
embed包替代go-bindata-assetfs,移除第三方依赖 - 新增
common/closer包,统一优雅关闭连接
2. 深度采用 gust 函数式库 (9b8d19f)
- 全面引入
gust的Result/Option/VoidResult类型(common/、app/、web/) - 采用
defer r.Catch() + .Unwrap()模式简化错误处理 sync.Map/atomic.Value替换为syncutil.SyncMap- 移除 Context 公开 API 中的 gust 类型,保持 JS 虚拟机兼容性
3. 修复爬虫规则 (fb174d9)
- 修复百度搜索、知乎日报、中国新闻网、房天下、微博粉丝、知乎编辑等多个静态规则
- 修正域名拼写、CSS 选择器、不安全 URL 拼接、未使用变量等问题
4. 配置系统重构与命名规范化 (e2aac49)
- 自定义 INI 解析器替换为
gopkg.in/ini.v1,配置集中到config/包 - 导出常量/字段统一为 Go 惯用 CamelCase(
VERSION→Version,WORK_ROOT→WorkRoot等) - receiver 名称从
self改为简短惯用名 - 重写 README.md,添加现代化布局和徽章
- 新增 bytes、gc、queue、util、config、cache、status、data、agent 包的单元测试
5. Chrome 无头浏览器下载器 (a4c31a7)
- 新增基于 chromedp 的 Chrome 下载器(
DownloaderID=2) - 支持首页优先导航绕过 JS 安全验证、反检测(隐藏 webdriver 标识)、共享浏览器进程保持 Cookie
- 修复
request.Prepare()中 DownloaderID 校验问题 - 更新百度搜索爬虫使用 Chrome 下载器
- 现代化 User-Agent 字符串(Chrome/Firefox/Edge 120-127)
6. 全面测试覆盖 (cd403a7)
- 为 30+ 个包新增单元测试,覆盖率达 ≥80%
- 修复已有测试失败(common/util、app/spider/timer、logs/logs/file)
- 清理无用代码块,为 28+ 个包添加包级注释
go test、go vet、go build全部通过
7. 注释与日志全量英文化 (91a5608)
- 翻译 pinyin_dict.go 中的 CJK 区块注释
- 翻译 sample/static_rules/ 下 32 个文件的中文注释
- 翻译 gui/、exec/、web/、config/ 中的中文注释
- 保留字符串字面量中的中文(Spider 名称、规则名、城市数据等用户侧数据)
v1.3.5
Refactor: modernize codebase and fix quality issues
- Upgrade Go to 1.24, replace deprecated APIs (ioutil, strings.Title)
- Migrate teleport into app/distribute/teleport, replace goutil with gust
- Fix go.mod/go.work multi-module resolution with replace directives
- Eliminate all dot imports, use named imports across rules/gui/app
- Fix all go vet warnings: lock copy, unreachable code, int-to-string
- Fix unit test (sess_cookie.go missing field), add build tags to gui
- Remove vendor, remove legacy // +build tags
- Improve dynamic rule parser: auto CDATA wrap, case-insensitive Script tags, support .pholcus.xml
- Update README with correct examples and modern build instructions
- Move rules/ module into sample/static_rules/ (eliminate separate module)
- Move dynamic rules from pholcus_pkg/spiders/ to dyn_rules/
- Rename entry point pholcus_web.go to main.go
- Remove rules module from go.work and go.mod
- Update config.ini spiderdir to dyn_rules
- Update README to reflect new project structure