Long image screenshot is incomplete

This issue has been tracked since 2022-05-18.

browserless chrome screenshots are incomplete for long images

dgtlmoon wrote this answer on 2022-05-18

You more than likely didn't provide nowhere near enough information for the fine people here to help you.... try to imagine that they are not sitting next to you

version? code example? method?

bestRunner wrote this answer on 2022-05-19

The following is the playwright version and code sample:

com.microsoft.playwright
playwright
1.17.0

public static void main(String[] args) throws Exception {
try (Playwright playwright = Playwright.create()) {
Browser browser = playwright.chromium().launch();
Page page = browser.newPage();
page.addInitScript(Paths.get("./scroll.js"));
Page.NavigateOptions navigateOptions = new Page.NavigateOptions();
navigateOptions.setWaitUntil(WaitUntilState.NETWORKIDLE);
page.navigate("https://www.meipian.cn/3eh6t1fr", navigateOptions);
while (true) {
page.keyboard().down("PageDown");
TimeUnit.MILLISECONDS.sleep(500);
Boolean isBottom = (Boolean) page.evaluate("isBottom()");
if (isBottom) {
TimeUnit.MILLISECONDS.sleep(500);
break;
}
}
page.evaluate("scrollTop()");

        TimeUnit.MILLISECONDS.sleep(1000);
        Page.ScreenshotOptions screenshotOptions = new Page.ScreenshotOptions();
        screenshotOptions.setFullPage(true);
        byte[] screenshot = page.screenshot(screenshotOptions);
        byte2image(screenshot, "./tmp.jpg");
        System.out.println("over!");
        browser.close();
    }
}
More Details About Repo
Owner Name browserless
Repo Name chrome
Full Name browserless/chrome
Language TypeScript
Created Date 2017-11-17
Updated Date 2023-03-22
Star Count 5309
Watcher Count 47
Fork Count 516
Issue Count 29

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date