INNER CODE UNIT · JavaScript
content
serverless/examples · aws-bedrock-agentcore/javascript/langgraph-browser-custom/index.js:77
const content = await page.evaluate(() => {
const body = document.body
return body ? body.innerText.substring(0, 2000) : ''
})
await browser.close()
return `Page Title: ${title}\n\nContent:\n${content}`
} finally {
// Stop the session - triggers recording upload to S3
await browserClient.stopSession()
console.log(
'Browser session stopped - recording should be uploaded to S3',
)
}
},
{
name: 'browse_webpage',