Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selenium/chrome console
#1
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)
Reply
#2
search for headless here: https://python-forum.io/Thread-Web-scraping-part-2
Reply
#3
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.
Reply
#4
I guess you mean the DevTools listening on message?
Look at this Thread.
Reply
#5
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I get rid of "Chrome is being controlled by automated test software"? jetBlack 2 12,554 Jul-21-2022, 08:31 AM
Last Post: Benjamin112
  How do I iterate over an array and perform actions using selenium chrome webdriver? master 0 2,387 Sep-14-2020, 05:28 AM
Last Post: master
  Expose chrome extension buttons to Python robertjaxe 2 2,313 May-12-2020, 07:52 PM
Last Post: robertjaxe
  Chrome instead of IE Friend 1 2,123 Feb-09-2020, 07:31 AM
Last Post: Larz60+
  Headless Chrome: How to login into a webpage? amandacstr 1 4,233 Feb-06-2020, 02:19 AM
Last Post: metulburr
  Interfacing Google Chrome & Python akornrumpf 5 3,995 Mar-16-2019, 10:20 PM
Last Post: Larz60+
  Cannot open Chrome gahhon 3 3,570 Jan-26-2019, 04:56 AM
Last Post: snippsat
  selenium - chrome crashes when chrome is running. RvBVakama 4 15,188 Dec-16-2018, 06:32 PM
Last Post: metulburr
  Alternatives to Chrome WebDriver? chisox721 4 7,095 Apr-23-2018, 06:24 PM
Last Post: chisox721
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,587 Nov-03-2017, 08:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020