1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "startUrls": [
10 "https://www.tripadvisor.com/Restaurant_Review-g60763-d25324283-Reviews-Allora_Fifth_Ave-New_York_City_New_York.html",
11 "https://www.tripadvisor.com/Hotel_Review-g60763-d15288822-Reviews-SpringHill_Suites_New_York_Manhattan_Times_Square_South-New_York_City_New_York.html?spAttributionToken=MjMyMTAzMzg",
12 ],
13 "types": ["all"],
14 "months": ["all"],
15 "languages": ["all"],
16 "ratings": ["all"],
17 "maxItems": 20,
18 "endPage": 1,
19 "customMapFunction": "(object) => { return {...object} }",
20 "proxy": { "useApifyProxy": True },
21}
22
23
24run = client.actor("epctex/tripadvisor-reviews-scraper").call(run_input=run_input)
25
26
27print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
28for item in client.dataset(run["defaultDatasetId"]).iterate_items():
29 print(item)
30
31