Accept cookies

This commit is contained in:
Lamp 2018-10-21 13:44:34 -07:00 committed by GitHub
parent b5c56de3bd
commit bfc008870e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,12 @@ global.screenshotter = {
try {
await page.goto('http://ourworldofpixels.com');
await page.evaluate(function () { OWOP.camera.zoom = 1; });
await new Promise(resolve => setTimeout(resolve, 2000));
await page.evaluate(function () {
for (let butt of document.getElementsByTagName('button')) {
if (butt.innerText == 'OK') {butt.click();break}
}
});
await new Promise(resolve => setTimeout(resolve, 5000));
let screenshot = await page.screenshot({ type: 'png' });
let filename = `Screenshot of ourworldofpixels.com/main @ ${new Date().toISOString()}.png`;