let option = new firefox.Options().addArguments("user-data-dir=C:\\Users\\Kulic\\AppData\\Local\\Google\\Chrome\\User Data\\Default").headless().windowSize(screen);
const {Builder, By} = require('selenium-webdriver');
const firefox = require('selenium-webdriver/chrome');
const until = require('selenium-webdriver/lib/until');
const screen = {
width: 1240,
height: 720
};
let option = new firefox.Options().addArguments("user-data-dir=C:\\Users\\Kulic\\AppData\\Local\\Google\\Chrome\\User Data\\Default").headless().windowSize(screen);
let driver = new Builder()
.forBrowser('chrome')
.setChromeOptions(option)
.build();
let adidas_url = "http://www.google.com";
driver.get(adidas_url)
.then(() => {
setTimeout(() => {
driver.takeScreenshot()
.then(
function(image, err) {
require('fs').writeFile('out.png', image, 'base64', function(err) {
console.log(err);
});
driver.quit();
}
);
}, 4000);
});