0

I've found a way to open a tab using webbrowser but that's not really what I'm looking for as it really needs to be a private window (a private tab is fine too). :/ any ideas ?

Aloïs Dsc
  • 11
  • 1
  • 1

2 Answers2

2

For chrome, you can use

import os
os.system("chrome -incognito http://example.com")

depending on your OS, chrome may be installed under a different name such as google-chrome or chrome-stable

dangee1705
  • 3,445
  • 1
  • 21
  • 40
0

For those who also came here and didn't find the answer, this helped me:

how to open chrome in incognito mode from Python

import webbrowser
url = 'www.google.com'
chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s --incognito'
webbrowser.get(chrome_path).open_new(url)

PS: Attention The chrome path may be different on your computer.

PS2: Please enter the link and credit the authors (how to open chrome in incognito mode from Python)