1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "search",
10 "searchTerms": ["harry potter"],
11 "sortBy": "relevance",
12 "onlyInStock": False,
13 "onlyOnSale": False,
14 "urls": [
15 "https://www.indigo.ca/products/harry-potter-and-the-philosopher-s-stone-25th-anniversary-edition",
16 "https://www.indigo.ca/products/harry-potter-and-the-philosopher-s-stone-25th-anniversary-edition?variant=46458034192594&utm_source=x",
17 "https://www.indigo.ca/en-ca/products/harry-potter-and-the-philosopher-s-stone-25th-anniversary-edition",
18 "https://www.indigo.ca/fr/products/harry-potter-and-the-philosopher-s-stone-25th-anniversary-edition",
19 "https://www.indigo.ca/collections/books",
20 "https://www.indigo.ca/search?q=harry+potter",
21 "https://m.indigo.ca/",
22 "https://www.chapters.indigo.ca/en-ca/books/product/9780547928227-item.html",
23 "https://www.indigo.ca/en-ca/search/?keywords=harry+potter",
24 ],
25 "fetchDetails": True,
26 "maxItems": 20,
27 "proxy": {
28 "useApifyProxy": True,
29 "apifyProxyGroups": ["RESIDENTIAL"],
30 "apifyProxyCountry": "CA",
31 },
32 "incrementalMode": False,
33 "compactUpdates": False,
34 "emitUnchanged": False,
35 "emitExpired": False,
36 "ignoreFieldsForChanges": [
37 "rating",
38 "reviewCount",
39 "inventoryATS",
40 "availableInStores",
41 "storesInStockCount",
42 ],
43 "notifyOnlyChanges": False,
44}
45
46
47run = client.actor("abotapi/indigo-ca-scraper").call(run_input=run_input)
48
49
50print(f"๐พ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
51for item in client.dataset(run.default_dataset_id).iterate_items():
52 print(item)
53
54