title: selenium hide chromdriver console window
body: <p>I have created a program with python where I am using selenium. I also created a .exe with pyinstaller. If I run the .exe chrome opens normally. But for some reason, the console appears too. This only happens if I am launching the .exe. If I launch the code in VS Code only the chrome window appears.</p>
  <p>I found something that is written in C#:</p>
  <pre><code>var driverService = ChromeDriverService.CreateDefaultService();
  driverService.HideCommandPromptWindow = true;
  
  var driver = new ChromeDriver(driverService, new ChromeOptions());
  </code></pre>
  <p>My chromdriver setup:</p>
  <pre><code>option = webdriver.ChromeOptions()
  option.add_argument(&quot;--incogneto&quot;)
  chromedriver_path = driverPath
  browser = webdriver.Chrome(chromedriver_path)
  browser.set_window_size(1100, 800)
  browser.get(&quot;myurl&quot;)
  </code></pre>
  <p>How can I do this in Python?</p>