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
3,731 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,090 points
TQ :)

IT WORKED FOR ME

Related Questions In Selenium

0 votes
1 answer

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

Simply Use this: driver.Manage().Window.Maximize(); READ MORE

answered Jun 7, 2018 in Selenium by Samarpit
• 5,890 points
8,623 views
0 votes
5 answers
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,065 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 in Selenium by Manoj
3,564 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,090 points
2,054 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,090 points
806 views