1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "messy_text",
10 "inputText": """Name: John Doe | Age: 29 | City: New York | Active: yes
11Name: Jane Smith | Age: 32 | City: Los Angeles | Active: true
12Name: Bob Johnson | Age: 45 | City: Chicago | Active: no""",
13 "fileUrl": "",
14 "urls": [{ "url": "https://books.toscrape.com/" }],
15 "textParseStrategy": "auto",
16 "kvFormat": "auto",
17 "htmlExtractMode": "auto",
18 "cssSelector": "article.product_pod",
19 "fieldMap": """{
20 \"title\": \"h3 a\",
21 \"price\": \".price_color\",
22 \"availability\": \".availability\",
23 \"rating\": \"p.star-rating\"
24}""",
25 "sheetName": "",
26 "skipEmptyRows": True,
27 "forwardFillColumns": "",
28 "pageSize": 0,
29 "outputFormat": "records",
30 "proxyConfiguration": { "useApifyProxy": True },
31 "maxRequestRetries": 3,
32}
33
34
35run = client.actor("moving_beacon-owner1/my-actor-66").call(run_input=run_input)
36
37
38print("πΎ Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
39for item in client.dataset(run["defaultDatasetId"]).iterate_items():
40 print(item)
41
42