1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "runMode": "DEVELOPMENT",
12 "startUrls": [
13 {
14 "url": "https://www.opentable.com/r/sample-restaurant"
15 }
16 ],
17 "respectRobotsTxtFile": true,
18 "linkSelector": "a[aria-label=\"Go to the next page\"]",
19 "globs": [],
20 "pseudoUrls": [],
21 "excludes": [],
22 "proxyConfiguration": {
23 "useApifyProxy": true
24 },
25 "initialCookies": [],
26 "waitUntil": [
27 "networkidle2"
28 ],
29 "preNavigationHooks": "[]",
30 "postNavigationHooks": "[]",
31 "breakpointLocation": "NONE",
32 "customData": {}
33};
34
35
36const run = await client.actor("vertivine/opentable-review-scraper").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46