fullPage screenshot duplicates page (doubles/tripples page length)
See original GitHub issueSo I’m having a weird problem with certain websites that I am trying to screenshoot. Essentially the page is shot and then replicated a number of times down in the png to make a really long screenshot that contains all these replications. Its like somebody copy pasted the page a couple of times onto the bottom of the original.
I have not been able to figure out which sites cause it, but the example below is an example- I can supply more if needed.
Steps to reproduce
Tell us about your environment:
- Puppeteer version: 0.13.0
- Platform / OS version: Ubuntu 17.04
- URLs (if applicable): https://bonobos.com/shop/tops
What steps will reproduce the problem?
Sample code with fullPage=True, i.e:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://bonobos.com/shop/tops');
await page.screenshot({path: 'example.png', fullPage: true});
await browser.close();
})();
What is the expected result? A pull page screenshot- not just the visible part
What happens instead? A very long image that contains multiple copies of the full page screenshot.
Don’t think the example will be visible, but worth a shot.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:14
- Comments:34 (1 by maintainers)
Top GitHub Comments
It seems that with
{deviceScaleFactor: 0}
it actually works as expected.Add
await page.setViewport({ width: 1000, height: 600, deviceScaleFactor: 0 });
afterconst browser = await puppeteer.launch(); const page = await browser.newPage();
This solution works for pages with height up to approx. 8700pxBecause the issue haven’t been resolved yet, I suggest you to use Playwright instead. It uses very similar syntax (most of the functions are named the same) and fullPage screenshot works like a charm without webpage height restrictions.
@aslushnikov Is there a plan to fix it?