Skip to content

Instantly share code, notes, and snippets.

@joelanman
Created March 18, 2018 20:56
Show Gist options
  • Save joelanman/dbbcaa074fe918dad5d6552054cd0d81 to your computer and use it in GitHub Desktop.
Save joelanman/dbbcaa074fe918dad5d6552054cd0d81 to your computer and use it in GitHub Desktop.
_asyncToGenerator(function* () {
const executablePath = (isLambda) ? __dirname + '/headless-chromium' : '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
console.log('executablePath: ' + executablePath);
const browser = yield puppeteer.launch({
args: ['--no-sandbox',
'--disable-setuid-sandbox',
'--single-process',
'--homedir=/tmp',
'--data-path=/tmp/data-path',
'--disk-cache-dir=/tmp/cache-dir'],
executablePath: executablePath
});
console.log('done launch')
const page = yield browser.newPage();
console.log('done newPage')
const inputHTML = 'https://www.gov.uk';
console.log('inputHTML: ' + inputHTML)
yield page.goto(inputHTML);
console.log('done goto')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment