Skip to content

Commit a5a7ac0

Browse files
committed
Update example code which was written for older version of the Actor
1 parent 678b4db commit a5a7ac0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

docs/02_concepts/code/06_interacting_call.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ async def main() -> None:
88
# Start the apify/screenshot-url Actor.
99
actor_run = await Actor.call(
1010
actor_id='apify/screenshot-url',
11-
run_input={'url': 'http://example.com', 'delay': 10000},
11+
run_input={
12+
'urls': [{'url': 'https://www.apify.com/'}],
13+
'delay': 1000,
14+
'waitUntil': 'load',
15+
},
1216
)
1317

1418
if actor_run is None:
@@ -18,10 +22,10 @@ async def main() -> None:
1822
run_client = Actor.apify_client.run(actor_run.id)
1923
await run_client.wait_for_finish()
2024

21-
# Get the Actor output from the key-value store.
22-
kvs_client = run_client.key_value_store()
23-
output = await kvs_client.get_record('OUTPUT')
24-
Actor.log.info(f'Actor output: {output}')
25+
# Get the Actor output from the dataset.
26+
dataset_client = run_client.dataset()
27+
item_list = await dataset_client.list_items()
28+
Actor.log.info(f'Actor output: {item_list.items}')
2529

2630

2731
if __name__ == '__main__':

0 commit comments

Comments
 (0)