1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "auto",
12 "accessMode": "preview",
13 "sources": [
14 "realestate",
15 "khmer24"
16 ],
17 "locations": [
18 "phnom-penh"
19 ],
20 "startUrls": [
21 {
22 "url": "https://www.realestate.com.kh/buy/"
23 },
24 {
25 "url": "https://www.realestate.com.kh/rent/"
26 },
27 {
28 "url": "https://www.khmer24.com/en/property.html"
29 },
30 {
31 "url": "https://www.khmer24.com/en/c-house-for-sale"
32 }
33 ],
34 "maxItems": 50
35};
36
37
38const run = await client.actor("mai_amm/cambodia-property-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