I am trying to capture screenshot of webpage using puppeteer page.screenshot method. But when I see the output screenshot it misses some part of page which is shadow root element inside html.
How can I
capture shadow root element also with puppeteer screenshot method. I am currently using below code. Example URL is https://www.buybuybaby.com/
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setExtraHTTPHeaders({
'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8',
accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'
})
await page.goto("https://www.buybuybaby.com/", { //URL with shadow root element
waitUntil: 'networkidle2',
timeout: 160000
})
await page.setViewport({
width: 1600,
height: 20000
})
await page.screenshot({path: 'screenshot.png'});
await browser.close();