Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blank screenshot with demo code #1852

Closed
benhalverson opened this issue Jan 18, 2018 · 1 comment
Closed

blank screenshot with demo code #1852

benhalverson opened this issue Jan 18, 2018 · 1 comment

Comments

@benhalverson
Copy link

I think this is related to #1828
When I used the demo code to take a screenshot. I am getting a white screen instead of the actual website. It happens both locally and with the below link.

What steps will reproduce the problem?

node app.js

const puppeteer = require('puppeteer');

(async () => {
    try {
    const browser = await puppeteer.launch({dumpio: true, args: ['--no-sandbox']});
    const page = await browser.newPage();

        await page.goto('https://community.adaptlearning.org/demo2/index.html');
        await page.screenshot({path: 'adaptdemo.png'});
        await browser.close();
    }
    catch(e) {
        console.log(`Error, ${e}`);
    }

})();

What is the expected result?
Screenshot of website with no errors.

What happens instead?

empty screenshot
I also get this message in the console.
[0118/135248.386202:ERROR:gpu_process_transport_factory.cc(1043)] Lost UI shared context.
DevTools listening on ws://127.0.0.1:49257/devtools/browser/3bb02c70-ae6d-4509-950d-698bc469182f

@aslushnikov
Copy link
Contributor

@benhalverson this is a fancy website that loads its data with xhr's. Use networkidle0 event to wait for it to load.

The following works just fine for me on pptr 1.4.0:

const puppeteer = require('.');

(async () => {
    try {
    const browser = await puppeteer.launch({dumpio: true, args: ['--no-sandbox']});
    const page = await browser.newPage();

        await page.goto('https://community.adaptlearning.org/demo2/index.html', {waitUntil: 'networkidle0'});
        await page.screenshot({path: 'adaptdemo.png'});
        await browser.close();
    }
    catch(e) {
        console.log(`Error, ${e}`);
    }

})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants