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
1,219 views

1 answer to this question.

0 votes

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,010 points

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,850 points
5,171 views
0 votes
5 answers
0 votes
2 answers

How to get HTML Source of WebElement in Selenium WebDriver using Python?

You can read innerHTML attribute to get source of ...READ MORE

answered Jun 13, 2018 in Selenium by Samarpit
• 5,850 points
21,259 views
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
646 views
+1 vote
1 answer
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,010 points
800 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,010 points
197 views