Play around with chrome headless

source code

1. get the chrome remote interface package
npm install chrome-remote-interface

2. run the code

    async client => {

    let {data} = await Page.captureScreenshot({
        format: 'png',


and even easier if using puppeteer

    const browser = await puppeteer.launch();
    const page = await browser.newPage();

    await page.goto('');
    await page.screenshot({ path: 'blog.png' });

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s