How do I pass options to the Selenium Chrome driver using Python?

0
0

The Selenium documentation mentions that the Chrome webdriver can take an instance of ChromeOptions, but I can’t figure out how to create ChromeOptions.

I’m hoping to pass the --disable-extensions flag to Chrome.

  • You must to post comments
0
0

Found the chrome Options class in the Selenium source code.

Usage to create a Chrome driver instance:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options
= Options()
chrome_options
.add_argument("--disable-extensions")
driver
= webdriver.Chrome(chrome_options=chrome_options)
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website