How to open a browser window in incognito private mode using the Python Selenium WebDriver?
Hi there Toby-steed,
To open a browser window in incognito or private mode, you have to use Chrome options to add incognito to the arguments of the Webdriver. The following example shows how to open the Chrome browser in Incognito mode:
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--incognito")
driver= webdriver.Chrome('C:\\Users\\John\\Downloads\\chromedriver.exe',chrome_options=chrome_options)
driver.implicitly_wait(2)
driver.maximize_window()
driver.get('https://www.google.com')