Skip to content

Instantly share code, notes, and snippets.

@nutjane
Created July 21, 2020 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nutjane/2628dba3fb56eb5f47b3c50288f8c294 to your computer and use it in GitHub Desktop.
Save nutjane/2628dba3fb56eb5f47b3c50288f8c294 to your computer and use it in GitHub Desktop.
const puppeteer = require('puppeteer');
(async() => {
const wsChromeEndpointurl = 'ws://127.0.0.1:9222/devtools/browser/df7b86aa-e82e-4124-93c4-a1a046d2943b'; // TODO: replace me
const browser = await puppeteer.connect({
browserWSEndpoint: wsChromeEndpointurl,
});
const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 800 })
const url = 'https://google.com'
await page.goto(url);
// do what you want ¯\_(ツ)_/¯
await page.close();
// await browser.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment