napperley
Coroutine failed: Error: Execution context was destroyed, most likely because of a navigation.
@Test fun testDomManipulation() { launch { val url = "<https://www.test.com>" val browser = Puppeteer.launch().await() val page = browser.newPage().await() val options = mapOf("timeout" to 10000) page.goto(url, options).await() println("Running page operation...") val resultHandle = page.evaluateHandle({ // Do something here... """{ "msg": "Page operation complete"}""" }).await() println("Result: ${resultHandle.jsonValue().await()}") resultHandle.dispose().await() browser.close() } }
A modern programming language that makes developers happier.