question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fullPage screenshot duplicates page (doubles/tripples page length)

See original GitHub issue

So 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:

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.

example Don’t think the example will be visible, but worth a shot.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:14
  • Comments:34 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
zubriktomascommented, Mar 8, 2021

It seems that with {deviceScaleFactor: 0} it actually works as expected.

Add await page.setViewport({ width: 1000, height: 600, deviceScaleFactor: 0 }); after const browser = await puppeteer.launch(); const page = await browser.newPage(); This solution works for pages with height up to approx. 8700px

Because 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.

6reactions
zxy198717commented, Apr 19, 2018

@aslushnikov Is there a plan to fix it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found