How to open browser window in incognito private mode using python selenium webdriver

0 votes
How to open browser window in incognito/private mode using python selenium webdriver?
Jul 31, 2019 in Selenium by Nuri
7,311 views

1 answer to this question.

+1 vote

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')
answered Jul 31, 2019 by Anvi
• 14,130 points
TQ :)

IT WORKED FOR ME

Related Questions In Selenium

0 votes
2 answers

How to open a browser window in full screen using Selenium WebDriver with C#

Hi , we have inbuilt method Maximize(). driver.Manage().Wind ...READ MORE

answered Sep 5, 2020 in Selenium by Sri
• 3,010 points
11,272 views
0 votes
8 answers

How to open a link in new tab of chrome browser using Selenium WebDriver?

This below code works for me in ...READ MORE

answered Dec 13, 2020 in Selenium by Gitika
• 65,870 points
60,972 views
0 votes
2 answers
0 votes
2 answers
0 votes
1 answer

How to Hover using Mouse in python using Webdriver

from selenium.webdriver.common.action_chains import ActionChains def hover(self): ...READ MORE

answered Aug 8, 2018 in Selenium by Meci Matt
• 9,460 points
1,392 views
+1 vote
2 answers

Python with Selenium issue: “Chrome is being controlled by automated test software”

from selenium import webdriver chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("useAutomationExtension", False) chrome_options.add_experimental_option("excludeSwitches",["enable-automation"]) driver ...READ MORE

answered Apr 20, 2020 in Selenium by Manoj
5,407 views
0 votes
1 answer

How to open Firefox window in Incognito mode using Selenium Webdriver?

Hi Pritha, you can use this code ...READ MORE

answered May 14, 2019 in Selenium by Anvi
• 14,130 points
3,253 views
0 votes
1 answer

How can I refresh a browser window in different ways using Selenium Webdriver?

Hello Piyush, you can refresh a browser ...READ MORE

answered May 28, 2019 in Selenium by Anvi
• 14,130 points
1,514 views