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.

page.screenshot full page option broken

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 5.4.1
  • Platform / OS version: macOS Catalina
  • URLs (if applicable):
  • Node.js version: 12

What steps will reproduce the problem?

// script.js

const puppeteer = require('puppeteer')

const main = async () => {
  const browser = await puppeteer.launch()
  const page = await browser.newPage()

  await page.goto('https://github.com/puppeteer/puppeteer/releases')

  await page.screenshot({ path: 'screenshot.png', fullPage: true })
  await browser.close()
}

main()
  1. Run the script node script.js
  2. See the result in screenshot.png

What is the expected result? The full-page screenshot should be displayed properly

What happens instead? This is the result (overlapped and duplicated screenshot) <kbd>screenshot</kbd>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

3reactions
dcosta-ptccommented, Nov 17, 2020

Appears to have been fixed on v5.5.0. Can you confirm @bernabe9?

1reaction
dcosta-ptccommented, Nov 5, 2020

Hi,

Same here, was updating puppeteer to latest version, and noticed was having a error in our visual tests regarding a page with 15k heigh page exactly like mentioned above. Page starts repeating after some height, in my case is around 8500px height.

Sample test created to test:

const puppeteer = require('puppeteer'); 
const url = "http://localhost/samplebigpage/";
async function run() {     
   let browser = await puppeteer.launch({ headless: true });
   let page = await browser.newPage();
   await page.goto(url, { waitUntil: "networkidle0", timeout: 60000 });
   await page.setViewport({ width: 1280, height: 1024 });
   await page.screenshot({
    path: "./screenshot.png",
    type: "png",
    fullPage: true,
  });
  await page.close();
  await browser.close();
} 
run();

Running this on latest versions of puppeteer 2, 3 and 4 gives a proper full screenshot. With latest 5 happens what is described.

Update: Tested the same but with headless: false and it worked properly. Maybe it’s a headless mode only issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Full-Page Screenshots on Safari Not Working? Here's How to ...
If your Safari is grouped with other apps in a folder on your Home Screen, first remove Safari from the folder and just...
Read more >
Full Page Screenshot function not working. - Apple Community
I took a screenshot from safari to take a full page but it does not give me the option to a full page....
Read more >
No Full Screen screenshot option iOS 15/ iPhone 13 pro
Before blasting with full erase, try this. Open Settings app, go to Safari → Advanced → Experimental Features and make sure that ScreenCapture ......
Read more >
Bug In iOS 14 Prevents Full Page Screenshot Function
Bug in iOS 14 prevents Full Page Screenshot function. If you keep Safari in a folder, you'll find that you can't take screenshots...
Read more >
In case of long articles, the screenshot > Full Page option cuts ...
Try going to "print" then when it shows the preview, use two fingers to make it full screen - you can then share...
Read more >

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