1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "search",
10 "locations": ["Paris"],
11 "urls": [
12 "https://www.leboncoin.fr/recherche?category=2&locations=Paris",
13 "https://www.leboncoin.fr/recherche?category=2&locations=Paris&page=2",
14 "https://www.leboncoin.fr/recherche?text=velo",
15 "https://www.leboncoin.fr/recherche?text=iphone&sort=time&order=desc",
16 "https://www.leboncoin.fr/recherche?category=9&locations=Lyon_69003&price=100000-300000&owner_type=private",
17 "https://www.leboncoin.fr/recherche?category=2",
18 "https://leboncoin.fr/recherche?text=velo",
19 "https://www.leboncoin.fr/c/voitures",
20 "https://www.leboncoin.fr/ad/voitures/3265894435",
21 "https://www.leboncoin.fr/ad/voitures/3265894435?foo=bar",
22 "https://www.leboncoin.fr/boutique/105204",
23 "https://www.leboncoin.fr/profile/3c584dc1-749e-4d51-a776-fddfc7093929",
24 ],
25 "proxy": {
26 "useApifyProxy": True,
27 "apifyProxyGroups": ["RESIDENTIAL"],
28 "apifyProxyCountry": "AT",
29 },
30 "incrementalMode": False,
31 "emitUnchanged": False,
32 "emitExpired": False,
33 "expireAfterMissedScans": 1,
34 "changeScope": "all",
35 "compactUpdates": False,
36 "ignoreFieldsForChanges": [],
37}
38
39
40run = client.actor("abotapi/leboncoin-fr-scraper").call(run_input=run_input)
41
42
43print(f"πΎ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
44for item in client.dataset(run.default_dataset_id).iterate_items():
45 print(item)
46
47