1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "urls": [
12 "https://www.markepear.dev/blog/developer-marketing-guide"
13 ],
14 "element_selector": "",
15 "js_script": async () => { return document.title; },
16 "js_timeout": 10,
17 "cookies": [
18 {
19 "name": "cna",
20 "value": "abc123",
21 "domain": ".example.com",
22 "path": "/",
23 "expires": null
24 }
25 ],
26 "max_retries_per_url": 2,
27 "ignore_url_failures": true,
28 "proxy": {
29 "useApifyProxy": false
30 }
31};
32
33
34const run = await client.actor("stealth_mode/web-content-scraper").call(input);
35
36
37console.log('Results from dataset');
38console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44