Created
April 6, 2022 06:59
-
-
Save gramcha/7fd7dee7505d38e713cfe97dd57c8e0e to your computer and use it in GitHub Desktop.
up chrome browser and go to a site
This file contains 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
const chrome = require('selenium-webdriver/chrome'); | |
const chromedriver = require('chromedriver'); | |
const { | |
By, | |
until, | |
Builder, | |
} = require('selenium-webdriver'); | |
const driver = new Builder().forBrowser('chrome') | |
.setChromeOptions(new chrome.Options() | |
.addArguments('--no-sandbox') | |
.addArguments('--disable-setuid-sandbox') | |
.addArguments('--disable-dev-shm-using') | |
.addArguments('--disable-extensions') | |
.addArguments('--disable-gpu') | |
.addArguments('disable-infobars') | |
.addArguments('--remote-debugging-port=9222') | |
.addArguments('--disable-dev-shm-usage')) | |
.build(); | |
driver.get('https://google.com/').then(async (data) => { | |
console.log('data -', data); | |
await driver.quit(); | |
}).catch((error) => { | |
console.error(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment