Navigate page till rendering last frame not networkidel
See original GitHub issueI’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:
- Created 6 years ago
- Comments:16 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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:
FWIW, I do have white spot with the code:
Big Image:
If I use
await puppeteer.launch({ headless: false });
I have no white spots, but the image seems distorted:Big image:
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.