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