@spider-cloud/spider-client 0.1.84 → 0.1.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +7 -0
- package/dist/client.js +9 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.js +4 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -66,6 +66,13 @@ export declare class Spider {
|
|
|
66
66
|
* @returns {Promise<any>} The screenshot data.
|
|
67
67
|
*/
|
|
68
68
|
screenshot(url: string, params?: GenericParams): Promise<any>;
|
|
69
|
+
/**
|
|
70
|
+
* Unblock a challenging url to get data.
|
|
71
|
+
* @param {string} url - The URL to get data from.
|
|
72
|
+
* @param {GenericParams} [params={}] - Configuration parameters for the screenshot.
|
|
73
|
+
* @returns {Promise<any>} The screenshot data.
|
|
74
|
+
*/
|
|
75
|
+
unblocker(url: string, params?: GenericParams): Promise<any>;
|
|
69
76
|
/**
|
|
70
77
|
* Perform a search and gather a list of websites to start crawling and collect resources.
|
|
71
78
|
* @param {string} search - The search query.
|
package/dist/client.js
CHANGED
|
@@ -117,6 +117,15 @@ class Spider {
|
|
|
117
117
|
async screenshot(url, params = {}) {
|
|
118
118
|
return this._apiPost(config_1.APIRoutes.Screenshot, { url: url, ...params });
|
|
119
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Unblock a challenging url to get data.
|
|
122
|
+
* @param {string} url - The URL to get data from.
|
|
123
|
+
* @param {GenericParams} [params={}] - Configuration parameters for the screenshot.
|
|
124
|
+
* @returns {Promise<any>} The screenshot data.
|
|
125
|
+
*/
|
|
126
|
+
async unblocker(url, params = {}) {
|
|
127
|
+
return this._apiPost(config_1.APIRoutes.Unblocker, { url: url, ...params });
|
|
128
|
+
}
|
|
120
129
|
/**
|
|
121
130
|
* Perform a search and gather a list of websites to start crawling and collect resources.
|
|
122
131
|
* @param {string} search - The search query.
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
|
@@ -32,6 +32,10 @@ var APIRoutes;
|
|
|
32
32
|
(function (APIRoutes) {
|
|
33
33
|
// Crawl a website to collect the contents. Can be one page or many.
|
|
34
34
|
APIRoutes["Crawl"] = "crawl";
|
|
35
|
+
// Scrape a website to collect the contents. Can be one page or many.
|
|
36
|
+
APIRoutes["Scrape"] = "scrape";
|
|
37
|
+
// Unblock a website to collect the contents. Can be one page or many.
|
|
38
|
+
APIRoutes["Unblocker"] = "unblocker";
|
|
35
39
|
// Crawl a website to collect the links. Can be one page or many.
|
|
36
40
|
APIRoutes["Links"] = "links";
|
|
37
41
|
// Crawl a website to collect screenshots. Can be one page or many.
|