const imageData = await $page.screenshot({ type: "png", encoding: "base64" }); const img_binary = { binary: { screenshot: { data: imageData, mimeType: "image/png", fileName: "screenshot.png", }, }, };