1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchTerms": [
12 "milk"
13 ],
14 "urls": [],
15 "maxProducts": 5,
16 "includeProductDetails": true,
17 "postcode": "",
18 "brands": [],
19 "allergens": [],
20 "lifestyle": [],
21 "healthStar": [],
22 "sortBy": "relevance",
23 "includeUnavailable": false,
24 "includeMarketplace": false,
25 "includeRatings": true,
26 "storeQuery": "",
27 "storeNo": "",
28 "includeNearbyStores": false,
29 "source": "online",
30 "states": [],
31 "maxProductsPerRegion": 1,
32 "includeStoreDirectory": false,
33 "categoryPaths": [],
34 "specials": []
35};
36
37
38const run = await client.actor("datascraperes/woolworths-products-scraper").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48