1

How do I hide console window?

I using headless chrome and selenium in gui app to scraping data from one web page.
When starting the app, open console window then display log of chromedriver.

Is there a way to hide chromedriver log on console when starting the app?

OS: windows10
python: 3.6.3
selenium 3.8.0
chromedriver: 2.33
Google Chrome canary

KiYugadgeter
  • 3,796
  • 7
  • 34
  • 74

1 Answers1

1

In Lib\site-packages\selenium\webdriver\common\services.py file

In Service class

in func start add creationflags argument

try:
        cmd = [self.path]
        cmd.extend(self.command_line_args())
        self.process = subprocess.Popen(cmd, env=self.env,
                                       close_fds=platform.system() != 'Windows', 
                                       stdout=self.log_file, 
                                       stderr=self.log_file,
                                       creationflags=0x08000000,
                                       stdin=PIPE)
except TypeError: ...
Acamori
  • 327
  • 1
  • 5
  • 15