Skip to content

Commit 51f2813

Browse files
committed
Types: detail version changed to detailTarget version
1 parent acaf52c commit 51f2813

File tree

8 files changed

+144
-86
lines changed

8 files changed

+144
-86
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# [v6.0.0](https://github.com/coder-hxl/x-crawl/compare/v5.1.0...v6.0.0) (2023-04-18)
2+
3+
### 🚨 重大改变
4+
5+
- 关于对每个爬取目标的结果处理:将会在单个目标完成后就开始进行处理,节省时间,提高性能。原先是等所有目标完成再处理,在爬过程中会有空闲时间。
6+
- 关于 crawlPage、crawlData 以及 crawlFile 这三个 API 的第二个参数回调函数的执行时机:将移到最后执行,获取的结果跟 Promise 方式的结果相同。
7+
- 关于类型:PageRequestConfig、DataRequestConfig 以及 FileRequestConfig 分别更改为 CrawlPageDetailTargetConfig、CrawlDataDetailTargetConfig 以及 CrawlFileDetailTargetConfig ,目的是为了不单单可以加请求的配置,也可以扩展更多。CrawlPageConfigObject、 CrawlDataConfigObject 以及 CrawlFileConfigObject 分别更改为 CrawlPageAdvancedConfig、CrawlDataAdvancedConfig 以及 CrawlFileAdvancedConfig。
8+
- 关于 crawlFile 的 fileConfig 里面的配置选项:可以直接在根对象配置中设置。beforeSave 生命周期函数更改为 onBeforeSaveFile。
9+
- 关于 crawlPage、crawlData 以及 crawlFile 的对象结果:移除 crawlCount 属性,可通过 retryCount + 1 获取次数。errorQueue 更名为 crawlErrorQueue。
10+
11+
### 🚀 特征
12+
13+
- 新增设备指纹,避免浏览器识别并跟踪我们的在线行为。可在进阶用法中设置,也可以通过详细用法指定设置。
14+
- 在创建爬虫应用的配置新增 crawlPage ,可以在 crawlPage.launchBrowser 选项中设置创建浏览器的配置(类型为 PuppeteerLaunchOptions 来自 Puppeteer)。
15+
- CrawlPageAdvancedConfig、CrawlDataAdvancedConfig 以及 CrawlFileAdvancedConfig 进阶用法里面的每个爬取请求 header 可以在进阶方式配置对象统一设置,不必为每个爬取配置重复设置一遍。
16+
- crawlPage 新增 viewport 选项,用于设置页面的视口。
17+
- 新增 onCrawlItemComplete 生命周期函数,将在每个爬取目标完成后执行,并且把爬取结果(类似 CrawlSingleRes)传入回调函数。可在进阶用法设置。
18+
119
# [v5.1.0](https://github.com/coder-hxl/x-crawl/compare/v5.0.2...v5.1.0) (2023-04-12)
220

321
### 🚨 Breaking Changes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ English | [简体中文](https://github.com/coder-hxl/x-crawl/blob/main/docs/cn.
44

55
x-crawl is a flexible Node.js multi-purpose crawler library. Used to crawl pages, crawl interfaces, crawl files, and poll crawls.
66

7-
> If you also like x-crawl, you can give [x-crawl repository](https://github.com/coder-hxl/x-crawl) a star to support it, thank you all for your support.
7+
> If you also like x-crawl, you can give [x-crawl repository](https://github.com/coder-hxl/x-crawl) a star to support it, thank you for your support!
88
99
## Features
1010

docs/cn.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
x-crawl 是一个灵活的 Node.js 多功能爬虫库。用于爬页面、爬接口、爬文件以及轮询爬。
66

7-
> 如果你也喜欢 x-crawl ,可以给 [x-crawl 存储库](https://github.com/coder-hxl/x-crawl) 点个 star 支持一下,感谢大家的支持
7+
> 如果你也喜欢 x-crawl ,可以给 [x-crawl 存储库](https://github.com/coder-hxl/x-crawl) 点个 star 支持一下,感谢大家的支持
88
99
## 特征
1010

1111
- **🔥 异步/同步** - 只需更改一下 mode 属性即可切换 异步/同步 爬取模式。
1212
- **⚙️ 多种功能** - 可爬页面、爬接口、爬文件以及轮询爬。并且支持爬取单个或多个。
1313
- **🖋️ 写法灵活** - 一种功能适配多种爬取配置、获取爬取结果的写法,写法非常灵活。
14+
- **👀 设备指纹** - 简单的配置即可避免浏览器唯一识别并跟踪我们的在线行为。
1415
- **⏱️ 间隔爬取** - 无间隔/固定间隔/随机间隔,可以有效 使用/避免 高并发爬取。
1516
- **🔄 失败重试** - 可针对所有爬取的请求设置,针对单次爬取的请求设置,针对单个请求设置进行失败重试。
1617
- **🚀 优先队列** - 根据单个请求的优先级使用优先爬取。

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dependencies": {
3131
"chalk": "4.1.2",
3232
"https-proxy-agent": "^5.0.1",
33-
"puppeteer": "19.8.0",
33+
"puppeteer": "19.9.0",
3434
"x-crawl": "link:"
3535
},
3636
"devDependencies": {

pnpm-lock.yaml

Lines changed: 55 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)