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 "subjects": [
13 "english"
14 ],
15 "urls": [
16 "https://preply.com/en/online/english-tutors",
17 "https://preply.com/en/online/english-tutors?page=2",
18 "https://preply.com/en/online/english-tutors?priceRange=10-20",
19 "https://preply.com/en/online/english-tutors?searchText=ielts",
20 "https://preply.com/en/online/english-tutors?tags=testprep_ielts",
21 "https://preply.com/en/online/math-tutors",
22 "https://preply.com/en/tutor/1347910",
23 "https://preply.com/es/tutor/1347910",
24 "https://preply.com/en/tutor/1347910?utm_source=x&sid=1",
25 "https://preply.com/tutor/1347910",
26 "https://preply.com/en/london/english-tutors",
27 "https://preply.com/es/online/profesores-de-ingles",
28 "https://m.preply.com/en/online/english-tutors",
29 "https://preply.com/sitemap.xml"
30 ],
31 "maxReviews": 20,
32 "proxy": {
33 "useApifyProxy": true,
34 "apifyProxyGroups": [
35 "RESIDENTIAL"
36 ]
37 },
38 "incrementalMode": false,
39 "emitExpired": false,
40 "compactUpdates": false,
41 "expireAfterMissedScans": 1,
42 "ignoreFieldsForChanges": []
43};
44
45
46const run = await client.actor("abotapi/preply-scraper").call(input);
47
48
49console.log('Results from dataset');
50console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56