1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "monitorId": "my-price-monitor",
10 "targets": [{
11 "id": "a-light-in-the-attic",
12 "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
13 "fields": [
14 {
15 "name": "title",
16 "selector": "h1",
17 "type": "text",
18 },
19 {
20 "name": "price",
21 "selector": ".price_color",
22 "type": "price",
23 "currency": "GBP",
24 "decimalSeparator": ".",
25 },
26 {
27 "name": "availability",
28 "selector": ".availability",
29 "type": "text",
30 },
31 ],
32 }],
33}
34
35
36run = client.actor("telvio/ai-change-monitor").call(run_input=run_input)
37
38
39print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
40for item in client.dataset(run.default_dataset_id).iterate_items():
41 print(item)
42
43