Python Forum
Selenium/chrome console - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Selenium/chrome console (/thread-25767.html)



Selenium/chrome console - WiPi - Apr-11-2020

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)



RE: Selenium/chrome console - Larz60+ - Apr-11-2020

search for headless here: https://python-forum.io/Thread-Web-scraping-part-2


RE: Selenium/chrome console - WiPi - Apr-11-2020

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.


RE: Selenium/chrome console - snippsat - Apr-11-2020

I guess you mean the DevTools listening on message?
Look at this Thread.


RE: Selenium/chrome console - WiPi - Apr-12-2020

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.