1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "searchTerms": [
13 "towel"
14 ],
15 "urls": [
16 "https://www.kmart.com.au/toys/",
17 "https://www.kmart.com.au/womens/",
18 "https://www.kmart.com.au/toys/?page=2",
19 "https://www.kmart.com.au/catalogue/",
20 "https://www.kmart.com.au/clearance/",
21 "https://www.kmart.com.au/brand/target/",
22 "https://www.kmart.com.au/search/?searchTerm=towel",
23 "https://www.kmart.com.au/product/madison-bath-towel-ocean-42442370/",
24 "https://www.kmart.com.au/category/home-and-living/home-decor/",
25 "https://www.kmart.com.au/category/online-exclusives/"
26 ],
27 "basketItems": [
28 {
29 "url": "https://www.kmart.com.au/product/madison-bath-towel-ocean-42442370/",
30 "quantity": 2
31 }
32 ],
33 "proxy": {
34 "useApifyProxy": true
35 },
36 "incrementalMode": false,
37 "emitUnchanged": false,
38 "emitExpired": false,
39 "changeScope": "all",
40 "compactUpdates": false,
41 "expireAfterMissedScans": 1,
42 "ignoreFieldsForChanges": []
43};
44
45
46const run = await client.actor("abotapi/kmart-au-scraper-lite").call(input);
47
48
49console.log('Results from dataset');
50console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56