1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "search",
10 "states": ["California"],
11 "practiceAreas": ["Personal Injury"],
12 "cities": [],
13 "startUrls": [
14 "https://lawyers.justia.com/lawyers/personal-injury/california",
15 "https://lawyers.justia.com/lawyers/family-law/new-york",
16 ],
17 "fetchDetails": True,
18 "fetchVcard": False,
19 "freeConsultationOnly": False,
20 "topRatedOnly": False,
21 "maxPages": 0,
22 "maxItems": 20,
23 "proxy": {
24 "useApifyProxy": True,
25 "apifyProxyGroups": ["RESIDENTIAL"],
26 "apifyProxyCountry": "US",
27 },
28 "incrementalMode": False,
29 "emitUnchanged": False,
30 "emitExpired": False,
31 "ignoreFieldsForChanges": [],
32}
33
34
35run = client.actor("abotapi/justia-lawyer-scraper").call(run_input=run_input)
36
37
38print(f"๐พ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
39for item in client.dataset(run.default_dataset_id).iterate_items():
40 print(item)
41
42