Created
March 18, 2018 20:56
-
-
Save joelanman/dbbcaa074fe918dad5d6552054cd0d81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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