1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 "https://docs.apify.com/platform/actors"
13 ],
14 "crawlLinks": true,
15 "maxPages": 20,
16 "maxDepth": 2,
17 "output": "both",
18 "includeUrlPatterns": [],
19 "excludeUrlPatterns": [],
20 "includeHtml": false,
21 "keepLinks": true,
22 "keepImages": true,
23 "chunkSize": 0,
24 "chunkOverlap": 0,
25 "respectRobots": true,
26 "maxSitemapUrls": 5000,
27 "maxConcurrency": 8,
28 "maxRunSecs": 240,
29 "proxyConfiguration": {
30 "useApifyProxy": true
31 }
32};
33
34
35const run = await client.actor("insight.solutions/website-content-extractor").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45