-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
28 lines (22 loc) · 770 Bytes
/
Copy pathrun.py
File metadata and controls
28 lines (22 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
agoda-scraper — Python example.
pip install apify-client
export APIFY_TOKEN=... # https://console.apify.com/account/integrations
python run.py
Docs: https://apify.com/bovi/agoda-scraper
"""
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run_input = { 'searchTerms': ['The Peninsula Bangkok'],
'lengthOfStay': 1,
'adults': 2,
'rooms': 1,
'includeReviews': False,
'reviewsPerHotel': 10,
'maxItems': 0,
'requestDelay': 1.5,
'proxyConfiguration': {'useApifyProxy': True, 'apifyProxyGroups': ['RESIDENTIAL']}}
run = client.actor("bovi/agoda-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)