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 +28 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +3 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
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
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.
|
|
1
|
+
export declare const VERSION = "1.0.7";
|
package/dist/version.js
CHANGED