Hi Nuri, to open a browser window in Incognito or Private mode, you have to use Chrome Options to add incognito in the arguments of the webdriver. Following example shows how to open chrome browser in incognito mode:
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--incognito")
driver = webdriver.Chrome('C:\\Users\\Anvi_R\\Downloads\\chromedriver.exe',chrome_options=chrome_options)
driver.implicitly_wait(2)
driver.maximize_window()
driver.get('https://www.quora.com')
Hope this will help!
To learn more, go for Python Master course today.
Thank!