Web Dev Solutions

Catalin Mititiuc

import { Builder } from 'selenium-webdriver'; import chrome from 'selenium-webdriver/chrome.js'; console.log("Start the browser.") let chromeOptions = new chrome.Options(); chromeOptions.addArguments('--headless', '--disable-gpu', '--no-sandbox'); let driver = new Builder() .forBrowser('chrome') .setChromeOptions(chromeOptions) .build(); console.log("Done!") console.log("Open Google.") await driver.get("https://google.com"); console.log("Done!") const html = await driver.getPageSource(); driver.quit()