1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "startUrls": [
10 "https://www.magicbricks.com/Real-estate-property-top-agents/agent-in-New%20Delhi?&proptype=Multistorey-Apartment,Builder-Floor-Apartment,Penthouse,Studio-Apartment,Residential-House,Villa&cityName=New-Delhi&bedrooms=11701,11702&postedSince=-1&mbTrackSrc=tabChange&isNRI=Y&page=1&category=S&multiLang=en",
11 "https://www.magicbricks.com/Real-estate-property-top-agents/agent-in-Mumbai?cityName=Mumbai&page=1&category=S&multiLang=en",
12 ],
13 "maxItemsPerUrl": 100,
14 "proxyConfiguration": {
15 "useApifyProxy": True,
16 "apifyProxyGroups": ["RESIDENTIAL"],
17 "apifyProxyCountry": "IN",
18 },
19}
20
21
22run = client.actor("contactminerlabs/magicbricks-agents-scraper").call(run_input=run_input)
23
24
25print(f"πΎ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
26for item in client.dataset(run.default_dataset_id).iterate_items():
27 print(item)
28
29