2
2
3
3
English | <a href =" #cn " style =" text-decoration : none " >简体中文</a >
4
4
5
- XCrawl is a Nodejs multifunctional crawler library. Provide configuration to batch fetch HTML, JSON, images , etc.
5
+ XCrawl is a Nodejs multifunctional crawler library. Crawl HTML, JSON, file resources , etc. through simple configuration .
6
6
7
7
## Install
8
8
@@ -47,7 +47,7 @@ class XCrawl {
47
47
constructor (baseConfig ?: IXCrawlBaseConifg )
48
48
fetchData<T = any>(config: IFetchDataConfig): Promise<IFetchCommon<T>>
49
49
fetchFile(config: IFetchFileConfig): Promise<IFetchCommon<IFileInfo>>
50
- fetchHTML(url : string): Promise<JSDOM>
50
+ fetchHTML(config : string | IFetchHTMLConfig ): Promise<JSDOM>
51
51
}
52
52
` ` `
53
53
@@ -130,7 +130,7 @@ fetchHTML is the method of the above <a href="#myXCrawl" style="text-decoration
130
130
- Type
131
131
132
132
` ` ` ts
133
- function fetchHTML (url : string ): Promise<JSDOM>
133
+ function fetchHTML (config : string | IFetchHTMLConfig ): Promise<JSDOM>
134
134
```
135
135
136
136
- Example
@@ -237,6 +237,12 @@ interface IFetchFileConfig extends IFetchBaseConifg {
237
237
}
238
238
` ` `
239
239
240
+ - IFetchHTMLConfig
241
+
242
+ ` ` ` ts
243
+ interface IFetchHTMLConfig extends IRequestConfig {}
244
+ ` ` `
245
+
240
246
## More
241
247
242
248
If you have any **questions** or **needs** , please submit **Issues in** https://github.com/coder-hxl/x-crawl/issues .
@@ -249,7 +255,7 @@ If you have any **questions** or **needs** , please submit **Issues in** https:/
249
255
250
256
<a href="#en" style="text-decoration: none">English</a> | 简体中文
251
257
252
- XCrawl 是 Nodejs 多功能爬虫库。提供配置即可批量抓取 HTML 、JSON、图片等等 。
258
+ XCrawl 是 Nodejs 多功能爬虫库。只需简单的配置即可抓取 HTML 、JSON、文件资源等等 。
253
259
254
260
## 安装
255
261
@@ -294,7 +300,7 @@ class XCrawl {
294
300
constructor(baseConfig?: IXCrawlBaseConifg)
295
301
fetchData<T = any>(config: IFetchDataConfig): Promise<IFetchCommon<T>>
296
302
fetchFile(config: IFetchFileConfig): Promise<IFetchCommon<IFileInfo>>
297
- fetchHTML(url : string): Promise<JSDOM>
303
+ fetchHTML(config : string | IFetchHTMLConfig ): Promise<JSDOM>
298
304
}
299
305
` ` `
300
306
@@ -377,7 +383,7 @@ fetchHTML 是上面 <a href="#cn-myXCrawl" style="text-decoration: none">myXCra
377
383
- 类型
378
384
379
385
` ` ` ts
380
- function fetchHTML(url : string): Promise<JSDOM>
386
+ function fetchHTML(config : string | IFetchHTMLConfig ): Promise<JSDOM>
381
387
` ` `
382
388
383
389
- 示例
@@ -484,6 +490,12 @@ interface IFetchFileConfig extends IFetchBaseConifg {
484
490
}
485
491
` ` `
486
492
493
+ - IFetchHTMLConfig
494
+
495
+ ` ` ` ts
496
+ interface IFetchHTMLConfig extends IRequestConfig {}
497
+ ` ` `
498
+
487
499
## 更多
488
500
489
501
如有 ** 问题** 或 ** 需求** 请在 https: // github.com/coder-hxl/x-crawl/issues 中提 **Issues** 。
0 commit comments