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.

Navigate page till rendering last frame not networkidel

See original GitHub issue

I’m taking screenshot for large html 6200*6000 , but i got large white space in the output image every time i try to take the image.

I made so many tests, and found out that there’re frames rendered after the load event, so i don’t get it in the captured image.

The red line showing the load event and there’s frames after that line.

I tried to read all the documentation for the package but i’m a civil engineer and don’t know lots in programming, i tried my best and couldn’t find a solution for it.

There’s 4 options in page.goto and they don’t solve the problem, here’s the url for the documentation . https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagegotourl-options

Here’s my code

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('D:\Image_2.HTML', {waitUntil: 'load'});
  function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}
console.log(page.frames())
  await page.screenshot({path: 'example.png',fullPage : true});

  await browser.close();
})();

Help please.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
vsemozhetbytcommented, Nov 30, 2017

@OmarAbdElNasser You can compare the upper right corner in both images: it seems like the left map part is copied above the right part in the second (headfull) image:

1

2reactions
vsemozhetbytcommented, Nov 30, 2017

FWIW, I do have white spot with the code:

Big Image:

example0


If I use await puppeteer.launch({ headless: false }); I have no white spots, but the image seems distorted:

Big image:

example1


So it seems the issue is not the load/rendering race, but the screenshot getting/saving, I am not sure how to fix this, if I am right.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Navigate page till rendering last frame not networkidel
I solved it using another packages, the problem was in writing the image not the rendering . so i split the big image...
Read more >
Navigate page till rendering last frame not networkidel #1500
I'm taking screenshot for large html 6200*6000 , but i got large white space in the output image every time i try to...
Read more >
Navigating & waiting - Checkly
Go with load; You server render and load in some non-crucial element in a lazy fashion? go for one of the networkidle variant....
Read more >
How to make puppeteer wait for page to load - Urlbox
It fires when the initial HTML document's DOM has been loaded and parsed. However, this does NOT wait for stylesheets, images, ...
Read more >
Puppeteer | Puppeteer
Puppeteer is a Node.js library which provides a high-level API to control Chrome/Chromium over the DevTools Protocol. Puppeteer runs in headless mode by...
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