1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "urls": ["https://www.magicbricks.com/property-for-sale/residential-real-estate?bedroom=2,3&proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment,Residential-House,Villa&cityName=New-Delhi"],
10 "max_retries_per_url": 2,
11 "proxy": {
12 "useApifyProxy": True,
13 "apifyProxyGroups": ["RESIDENTIAL"],
14 "apifyProxyCountry": "US",
15 },
16}
17
18
19run = client.actor("ecomscrape/magicbricks-property-search-scraper").call(run_input=run_input)
20
21
22print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
23for item in client.dataset(run["defaultDatasetId"]).iterate_items():
24 print(item)
25
26