2

i have some selenium code written in python but the problem is that selenium always prints out this output at the start of a program

DevTools listening on ws://ip address/devtools/browser/some numbers

and since my computer doesn't support bluetooth i get also this output:

[10376:9472:1101/171134.942:ERROR:device_event_log_impl.cc(208)] [17:11:34.941] Bluetooth: bluetooth_adapter_winrt.cc:1076 Getting Default Adapter failed.

is there a way to eliminate only selenium's output?

Fghjkgcfxx56u
  • 99
  • 1
  • 11

2 Answers2

2

I use the below that I found on SO here

    options = webdriver.ChromeOptions()
    # disable some annoying debug output to console
    options.add_argument('--log-level=3')
    options.add_experimental_option('excludeSwitches', ['enable-logging'])

    browser = webdriver.Chrome(
        "C://Program Files (x86)//Google//Chrome//Application//chromedriver.exe", options=options)

piterbarg
  • 8,089
  • 2
  • 6
  • 22
1

I think if you add this to your code/change your code to this, it should solve it

driver = webdriver.Chrome(service_log_path=os.devnull)

it should tell the selenium, that you don't want to put anything in logs

Oliver Hnat
  • 797
  • 4
  • 19