Back
I can not seem to find any documentation on how to make Selenium open the browser in incognito mode.
Do I have to set up a custom profile in the browser or?
There is a really simple way to make a window open in incognito mode:
from selenium.webdriver.chrome.options import Optionschrome_options = Options()# incognito windowchrome_options.add_argument("--incognito")
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
# incognito window
chrome_options.add_argument("--incognito")
You can also use this library for maximizing the window and more, see the documentation: https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/Chrome/Options.html
31k questions
32.8k answers
501 comments
693 users