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 {
13 "url": "https://crawlee.dev/js"
14 }
15 ],
16 "globs": [
17 {
18 "glob": "https://crawlee.dev/js/*/*"
19 }
20 ],
21 "pseudoUrls": [],
22 "excludes": [
23 {
24 "glob": "/**/*.{png,jpg,jpeg,pdf}"
25 }
26 ],
27 "linkSelector": "a",
28 "respectRobotsTxtFile": true,
29 "initialCookies": [],
30 "customHttpHeaders": {},
31 "proxyConfiguration": {
32 "useApifyProxy": true
33 },
34 "launcher": "CHROMIUM",
35 "waitUntil": "DOM_CONTENT_LOADED",
36 "customData": {}
37};
38
39
40const run = await client.actor("shortc/htmlwasher-beta").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50