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 "sort": "Relevance",
16 "urls": [
17 "https://www.takealot.com/deals?start=1"
18 ],
19 "fetchDetails": true,
20 "fetchReviews": false,
21 "maxReviewsPerProduct": 5,
22 "maxItems": 20,
23 "maxPages": 0,
24 "incrementalMode": false,
25 "emitUnchanged": false,
26 "emitExpired": false,
27 "maxNotifyListings": 50,
28 "proxyConfiguration": {
29 "useApifyProxy": true
30 }
31};
32
33
34const run = await client.actor("abotapi/takealot-com-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