sindresorhus/capture-website

Problem if page is longer than 8192px

richtrefz opened this issue · 5 comments

If the rendered website page is longer than 8192 px, the .png file is nor right. At 8192 px down, the top of the web page repeats

attachment is a very shrunken capture of https://api.jquery.com/
but you can see the repeated header

jq

Apologies for the thread-bump but confirming this behavior on all sites. As well, across both Linux and Windows.
I hope to investigate the root cause soon.

image

Using puppeteer only gives the same results:

	const browser = await puppeteer.launch();
	const page = await browser.newPage();
	await page.goto('https://api.jquery.com/');
	const screenshot = await page.screenshot({
		fullPage: true
	});

	require('fs').writeFileSync('test.png', screenshot);
	await page.close();

Edit: if you really need this to work you can install puppeteer with Firefox, it works correctly with it: https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#puppeteerproduct

Appears to be a Chromium issue: https://bugs.chromium.org/p/chromium/issues/detail?id=1043959&q=screenshot%20fullPage&can=2. The only reliable workaround I've seen is to take a bunch of partial screenshots as you scroll and then stitch them back together.

Hi @krnik, did you actually succeed using firefox along capture-website? If yes, i'm curious about how you do that. When I try, I always hit this error puppeteer/puppeteer#6323

Yes, it did succeed. But I used only one option fullPage as in the example above. Maybe that's the problem here.