executable_path=os.environ.get("CHROMEDRIVER_PATH") chrome_options=chrome_options driver = webdriver.Chrome(executable_path, chrome_options) code example

Example 1: selenium set chrome executable path

chromedriver = "/path/to/chromedriver"
options = Options()
options.binary_location = '/path/to/chrome'
driver = webdriver.Chrome(chromedriver, chrome_options=options)

Example 2: selenium set chrome executable path

ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/chrome/binary");

ChromeDriver driver = new ChromeDriver(options);

Tags:

Misc Example