1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "url": "https://news.ycombinator.com/",
10 "attributes": [
11 {
12 "description": "News title",
13 "name": "title",
14 },
15 {
16 "description": "Number of points",
17 "name": "points",
18 },
19 {
20 "description": "Number of comments",
21 "name": "comments",
22 },
23 ],
24}
25
26
27run = client.actor("parsera-labs/parsera").call(run_input=run_input)
28
29
30print(f"๐พ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
31for item in client.dataset(run.default_dataset_id).iterate_items():
32 print(item)
33
34