1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "startUrls": [
10 { "url": "https://www.willhaben.at/iad/immobilien/mietwohnungen/mietwohnung-angebote?areaId=5" },
11 { "url": "https://www.willhaben.at/jobs/suche?employment_type=109&location=Salzburg®ion=14096" },
12 ],
13 "maxItems": 5,
14 "flattenOutput": True,
15 "maxConcurrency": 10,
16 "maxRequestRetries": 3,
17 "proxy": {
18 "useApifyProxy": True,
19 "apifyProxyGroups": ["RESIDENTIAL"],
20 "apifyProxyCountry": "AT",
21 },
22}
23
24
25run = client.actor("parsebird/willhaben-scraper").call(run_input=run_input)
26
27
28print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
29for item in client.dataset(run.default_dataset_id).iterate_items():
30 print(item)
31
32