Python Forum

Full Version: Selenium/chrome console
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

I am running selenium webdriver with headless Chrome (my basic code below) to scrape multiple web pages.

Does anybody know the correct code to hide the chrome.exe console?

#set up selenium webdriver (headless)
        option = webdriver.ChromeOptions()
        #option.add_argument("--window-size=1920,1080")
        #option.add_argument("--start-maximized")
        option.add_argument("--headless")
        browser = webdriver.Chrome('C:\\Users\\chromedriver.exe',options = option)
        browser.get(url)
As far as I can see this code does not have an option to hide the chrome.exe command console. The headless option prevents the web page from physically opening but the command console still opens. This is the one I want to hide as well.
I guess you mean the DevTools listening on message?
Look at this Thread.
Yes the Dev Tools window. I was going to put an image up but don't know how to do that here!! When I click the image icon it asks me for a URL????.

I am also using Threadpool processing so I get about 12 of these windows all open on my screen!! They don't serve any purpose because the text is written too fast to read and if there is an error I can see what that is in Python shell (I am using IDLE IDE at the moment).

I did implement suggested changes in service.py but it didn't like the syntax creationflags=CREATE_NO_WINDOW

Thanks for pointing out the thread though.