1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "startUrl": "https://example.com",
10 "actions": [
11 {
12 "type": "waitForSelector",
13 "locator": {
14 "by": "css",
15 "value": "h1",
16 },
17 },
18 {
19 "type": "extractText",
20 "locator": {
21 "by": "css",
22 "value": "h1",
23 },
24 },
25 {
26 "type": "textContains",
27 "locator": {
28 "by": "css",
29 "value": "h1",
30 },
31 "expected": "Example Domain",
32 },
33 ],
34 "proxyConfiguration": { "useApifyProxy": False },
35}
36
37
38run = client.actor("produkdigitalali/playwright-browser-automation-runner").call(run_input=run_input)
39
40
41print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
42for item in client.dataset(run.default_dataset_id).iterate_items():
43 print(item)
44
45