1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "search",
10 "searchTerms": ["iphone"],
11 "urls": [
12 "https://24h.pchome.com.tw/search/iphone",
13 "https://24h.pchome.com.tw/search/?q=iphone",
14 "https://24h.pchome.com.tw/category/DYAJ95C",
15 "https://24h.pchome.com.tw/prod/DYAJ01-A900J9CU7",
16 "https://24h.pchome.com.tw/prod/DYAJ01-A900J9CU7?fq=/S/DYAJ01&utm_source=x",
17 "https://24h.pchome.com.tw/store/DYAJ01",
18 "https://24h.pchome.com.tw/region/DYAJ",
19 "https://24h.pchome.com.tw/sign/mobile",
20 "https://24h.pchome.com.tw/sites/sandisk",
21 "https://m.pchome.com.tw/",
22 ],
23 "maxReviews": 20,
24 "proxy": { "useApifyProxy": True },
25 "incrementalMode": False,
26 "emitExpired": False,
27 "compactUpdates": False,
28 "expireAfterMissedScans": 1,
29 "ignoreFieldsForChanges": [],
30}
31
32
33run = client.actor("abotapi/pchome-24h-scraper").call(run_input=run_input)
34
35
36print(f"πΎ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
37for item in client.dataset(run.default_dataset_id).iterate_items():
38 print(item)
39
40