zenrows 1.0.6 → 1.0.7

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/README.md CHANGED
@@ -37,6 +37,30 @@ const url = 'https://www.zenrows.com/';
37
37
 
38
38
  // Make your request from a given country. Requires premium_proxy
39
39
  proxy_country: '',
40
+
41
+ // Wait for a given CSS Selector to load in the DOM. Requires js_render
42
+ wait_for: '.content',
43
+
44
+ // Wait a fixed amount of time in milliseconds. Requires js_render
45
+ wait: 2500,
46
+
47
+ // Block specific resources from loading, check docs for the full list. Requires js_render
48
+ block_resources: 'image,media,font',
49
+
50
+ // Change the browser's window width and height. Requires js_render
51
+ window_width: 1920,
52
+ window_height: 1080,
53
+
54
+ // Will automatically use either desktop or mobile user agents in the headers
55
+ device: 'desktop',
56
+
57
+ // Will return the status code returned by the website
58
+ original_status: false,
59
+ }, {
60
+ headers: {
61
+ Referrer: 'https://www.google.com',
62
+ 'User-Agent': 'MyCustomUserAgent',
63
+ },
40
64
  });
41
65
 
42
66
  console.log(data);
@@ -56,6 +80,10 @@ const url = 'https://www.zenrows.com/';
56
80
  })();
57
81
  ```
58
82
 
83
+ You can also pass optional parameters and headers; the list above is a reference. For more info, check out [the documentation page](https://www.zenrows.com/documentation).
84
+
85
+ Sending headers to the target URL will overwrite our defaults. Be careful when doing it and contact us if there is any problem.
86
+
59
87
  ## Examples
60
88
 
61
89
  Take a look at the [examples directory](./examples) for Javascript and TypeScript files using the SDK.
package/dist/index.d.ts CHANGED
@@ -5,6 +5,14 @@ interface Config {
5
5
  js_render?: boolean;
6
6
  premium_proxy?: boolean;
7
7
  proxy_country?: string;
8
+ wait_for?: string;
9
+ wait?: number;
10
+ block_resources?: string;
11
+ window_width?: number;
12
+ window_height?: number;
13
+ device?: string;
14
+ original_status?: boolean;
15
+ custom_headers?: boolean;
8
16
  [x: string]: unknown;
9
17
  }
10
18
  interface Headers {
package/dist/index.js CHANGED
@@ -16,6 +16,9 @@ class ZenRows {
16
16
  params,
17
17
  headers: finalHeaders,
18
18
  };
19
+ if (headers && Object.keys(headers).length) {
20
+ params.custom_headers = true;
21
+ }
19
22
  return (0, axios_1.default)(axiosRequestConfig);
20
23
  }
21
24
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.0.6";
1
+ export declare const VERSION = "1.0.7";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.0.6';
4
+ exports.VERSION = '1.0.7';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zenrows",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "ZenRows Node SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",