Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ulixee
GitHub Repository: ulixee/secret-agent
Path: blob/main/examples/handler.mjs
1028 views
1
import { Handler } from 'secret-agent';
2
3
(async function run() {
4
const handler = new Handler();
5
handler.dispatchAgent(async agent => {
6
await agent.goto('https://news.ycombinator.com');
7
await agent.waitForPaintingStable();
8
});
9
handler.dispatchAgent(async agent => {
10
await agent.goto('https://news.ycombinator.com/newest');
11
await agent.waitForPaintingStable();
12
});
13
await handler.waitForAllDispatches();
14
await handler.close();
15
})();
16
17