

I am using IDLE and have installed selenium module and Firefox browser. Now I'm studying Sweigart's "automatically writing boring things in Python text".

I started to use Python about two months ago. It is also important to note that ChromeDriver is a completely separate project from Selenium Webdriver part of why it took me a bit to find the solution is because I kept searching Selenium’s source code for text that was too specific to ChromeDriver – ChromeDriver itself actually lives in the Google chromium mono-repo.I'm a new programmer. I didn’t want to spend too much time digging into this, but my guess at why this behavior was introduced and past logging options no longer works is that the new flag probably overrides any granular settings, such as the old solution of -log-level-3.

Options.add_experimental_option('excludeSwitches', ) Some More Background I found this via this S/O answer and the linked ChromeDriver Issue.Ī concise example of adding the switch is this: const = require('selenium-webdriver/chrome') ĬhromeOptions.excludeSwitches('enable-logging') Turns out, ChromeDriver has a default switch that enables logging – -enable-logging you need to pass this to Selenium to turn it off. So, anything passed through excludeSwitches basically negates / removes a flag normally set as true by ChromeDriver. The solution involves the use of excludeSwitches – these are switches / flags that you want to exclude ChromeDriver from including by default. I still got messages after creating a webdriver instance with these preferences Solution My first attempt tried to use this approach and failed: const wdLogging = require('selenium-webdriver/lib/logging') Ĭonst loggingPrefs = new wdLogging.Preferences() To be clear, even if you explicitly tell Selenium that you want all logging off, you will still get this message. To start with, it seems at first as though it is impossible to get rid of this log message: “ DevTools listening on ws://.” when first connecting. The issue, which you can find many users complaining about, is that when using Chrome as the browser with Selenium Webdriver and NodeJS, the default log preferences don’t seem to be respected and messages still appear in the console / stdout.

This is a quick post, but took a little digging to come up with the solution featured.
