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 "queries": [
13 "laptop"
14 ],
15 "urls": [
16 "https://www.officeworks.com.au/shop/officeworks/search?q=laptop",
17 "https://www.officeworks.com.au/shop/officeworks/search?q=laptop&page=2",
18 "https://www.officeworks.com.au/shop/officeworks/c/office-supplies/pens/ballpoint-pens",
19 "https://www.officeworks.com.au/shop/officeworks/c/office-supplies/pens/ballpoint-pens?page=2",
20 "https://www.officeworks.com.au/shop/officeworks/c/art-supplies",
21 "https://www.officeworks.com.au/shop/officeworks/p/mac-mini-m6-12-core-cpu-12-core-gpu-16-256gb-immm6162",
22 "https://www.officeworks.com.au/shop/officeworks/search?q=IMMM6162",
23 "https://www.officeworks.com.au/shop/officeworks/c/deals",
24 "https://www.officeworks.com.au/shop/officeworks/c/clearance",
25 "https://www.officeworks.com.au/shop/officeworks/p/JBCNCPA480"
26 ],
27 "proxy": {
28 "useApifyProxy": true
29 },
30 "ignoreFieldsForChanges": []
31};
32
33
34const run = await client.actor("abotapi/officeworks-scraper").call(input);
35
36
37console.log('Results from dataset');
38console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44