1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "url": "https://ollama.com/library",
10 "itemSelector": "#repo li",
11 "fields": {
12 "name": "div[title]::attr(title)",
13 "url": "a::attr(href)",
14 "description": "p.max-w-lg::text",
15 "pulls": "p.my-4 > span:nth-of-type(1) > span:nth-of-type(1)::text",
16 "tag_count": "p.my-4 > span:nth-of-type(2) > span:nth-of-type(1)::text",
17 "updated": "p.my-4 > span:nth-of-type(3) > span:nth-of-type(2)::text",
18 "capabilities": "span.bg-indigo-50::text",
19 "sizes": "span.text-blue-600::text",
20 },
21 "proxy": { "useApifyProxy": True },
22}
23
24
25run = client.actor("zenolvepro/ollama-library").call(run_input=run_input)
26
27
28print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
29for item in client.dataset(run["defaultDatasetId"]).iterate_items():
30 print(item)
31
32