22
33English | <a href =" #cn " style =" text-decoration : none " >简体中文</a >
44
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 .
66
77## Install
88
@@ -47,7 +47,7 @@ class XCrawl {
4747 constructor (baseConfig ?: IXCrawlBaseConifg )
4848 fetchData<T = any>(config: IFetchDataConfig): Promise<IFetchCommon<T>>
4949 fetchFile(config: IFetchFileConfig): Promise<IFetchCommon<IFileInfo>>
50- fetchHTML(url : string): Promise<JSDOM>
50+ fetchHTML(config : string | IFetchHTMLConfig ): Promise<JSDOM>
5151}
5252` ` `
5353
@@ -130,7 +130,7 @@ fetchHTML is the method of the above <a href="#myXCrawl" style="text-decoration
130130- Type
131131
132132` ` ` ts
133- function fetchHTML (url : string ): Promise<JSDOM>
133+ function fetchHTML (config : string | IFetchHTMLConfig ): Promise<JSDOM>
134134```
135135
136136- Example
@@ -237,6 +237,12 @@ interface IFetchFileConfig extends IFetchBaseConifg {
237237}
238238` ` `
239239
240+ - IFetchHTMLConfig
241+
242+ ` ` ` ts
243+ interface IFetchHTMLConfig extends IRequestConfig {}
244+ ` ` `
245+
240246## More
241247
242248If 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:/
249255
250256<a href="#en" style="text-decoration: none">English</a> | 简体中文
251257
252- XCrawl 是 Nodejs 多功能爬虫库。提供配置即可批量抓取 HTML 、JSON、图片等等 。
258+ XCrawl 是 Nodejs 多功能爬虫库。只需简单的配置即可抓取 HTML 、JSON、文件资源等等 。
253259
254260## 安装
255261
@@ -294,7 +300,7 @@ class XCrawl {
294300 constructor(baseConfig?: IXCrawlBaseConifg)
295301 fetchData<T = any>(config: IFetchDataConfig): Promise<IFetchCommon<T>>
296302 fetchFile(config: IFetchFileConfig): Promise<IFetchCommon<IFileInfo>>
297- fetchHTML(url : string): Promise<JSDOM>
303+ fetchHTML(config : string | IFetchHTMLConfig ): Promise<JSDOM>
298304}
299305` ` `
300306
@@ -377,7 +383,7 @@ fetchHTML 是上面 <a href="#cn-myXCrawl" style="text-decoration: none">myXCra
377383- 类型
378384
379385` ` ` ts
380- function fetchHTML(url : string): Promise<JSDOM>
386+ function fetchHTML(config : string | IFetchHTMLConfig ): Promise<JSDOM>
381387` ` `
382388
383389- 示例
@@ -484,6 +490,12 @@ interface IFetchFileConfig extends IFetchBaseConifg {
484490}
485491` ` `
486492
493+ - IFetchHTMLConfig
494+
495+ ` ` ` ts
496+ interface IFetchHTMLConfig extends IRequestConfig {}
497+ ` ` `
498+
487499## 更多
488500
489501如有 ** 问题** 或 ** 需求** 请在 https: // github.com/coder-hxl/x-crawl/issues 中提 **Issues** 。
0 commit comments