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 "milk"
14 ],
15 "market": "AE",
16 "language": "en",
17 "sortBy": "relevance",
18 "inStockOnly": false,
19 "urls": [
20 "https://gcc.luluhypermarket.com/en-ae/",
21 "https://gcc.luluhypermarket.com/en-ae/grocery/",
22 "https://gcc.luluhypermarket.com/en-ae/grocery-food-cupboard-canned-foods/",
23 "https://gcc.luluhypermarket.com/en-ae/grocery-food-cupboard-canned-foods/?page=2",
24 "https://gcc.luluhypermarket.com/en-ae/list/?search_text=milk",
25 "https://gcc.luluhypermarket.com/list/?search_text=milk&format=json",
26 "https://gcc.luluhypermarket.com/list/?category_ids=5019&format=json",
27 "https://gcc.luluhypermarket.com/en-ae/kdd-tomato-paste-135-g/p/138450-ea/",
28 "https://gcc.luluhypermarket.com/kdd-tomato-paste-135-g/p/138450-ea/?format=json",
29 "https://gcc.luluhypermarket.com/en-sa/grocery/",
30 "https://gcc.luluhypermarket.com/en-ae/c/Bulk-Savings/",
31 "https://gcc.luluhypermarket.com/en-ae/grocery-food-cupboard-breakfast-spreads/?sorter=-discount_ratio",
32 "https://gcc.luluhypermarket.com/en-ae/list/?attributes_brand=LuLu%20PL",
33 "https://gcc.luluhypermarket.com/ar-ae/grocery/"
34 ],
35 "fetchDetails": true,
36 "includeFacets": true,
37 "maxItems": 20,
38 "proxy": {
39 "useApifyProxy": true
40 },
41 "incrementalMode": false,
42 "compactUpdates": false,
43 "emitUnchanged": false,
44 "emitExpired": false,
45 "ignoreFieldsForChanges": [],
46 "notifyOnlyChanges": false
47};
48
49
50const run = await client.actor("abotapi/luluhypermarket-scraper").call(input);
51
52
53console.log('Results from dataset');
54console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
55const { items } = await client.dataset(run.defaultDatasetId).listItems();
56items.forEach((item) => {
57 console.dir(item);
58});
59
60