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 "locations": [
13 "London"
14 ],
15 "treatments": [
16 "Haircuts and hairdressing"
17 ],
18 "urls": [
19 "https://www.treatwell.co.uk/places/treatment-haircuts-and-hairdressing/offer-type-local/in-london-uk/",
20 "https://www.treatwell.co.uk/places/treatment-haircuts-and-hairdressing/offer-type-local/in-manchester-uk/sort-price-asc/page-2/",
21 "https://www.treatwell.co.uk/places/brand-olaplex/in-london-uk/",
22 "https://www.treatwell.co.uk/places/chain-live-true-london/",
23 "https://www.treatwell.co.uk/place/lili-london/",
24 "https://www.treatwell.co.uk/hairdressers-and-hair-salons/"
25 ],
26 "fetchDetails": true,
27 "maxReviews": 20,
28 "maxItems": 20,
29 "proxy": {
30 "useApifyProxy": true
31 },
32 "incrementalMode": false,
33 "emitUnchanged": false,
34 "emitExpired": true
35};
36
37
38const run = await client.actor("abotapi/treatwell-co-uk-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