2

I'm running a python script to scrape some webpages and am using selenium + chromedriver. The script is working fine and doing what it's meant to do without crashing, howver chromedriver is logging audio errors that I can't silence.

Error Log

I'm using log-level 3 so that only fatal errors should print, but I'm still getting the above. I also tried the option to disable logging and again I still got the same output as above.

options = webdriver.ChromeOptions() 
options.add_argument('--disable-gpu')
options.add_argument('--start-maximized')
options.add_argument('--log-level=3')
#options.add_argument('--disable-logging')

driver = webdriver.Chrome(chrome_options = options)
driver.get(link)

Any help to get round this would be greatly appreciated!

Nik-D
  • 31
  • 3

1 Answers1

2

Just try using the --mute-audio argument this should disable the audio.

like this:

options = webdriver.ChromeOptions() 
options.add_argument('--disable-gpu')
options.add_argument('--start-maximized')
options.add_argument('--log-level=3')
# options.add_argument('--disable-logging')
options.add_argument("--mute-audio")

driver = webdriver.Chrome(chrome_options = options)
driver.get(link)

EDIT:

Try using logging (this is based on this answer):

import logging
from selenium.webdriver.remote.remote_connection import LOGGER


LOGGER.setLevel(logging.WARNING)
options = webdriver.ChromeOptions()


options.add_argument('--disable-gpu')
options.add_argument('--start-maximized')
options.add_argument('--log-level=3')
# options.add_argument('--disable-logging')
options.add_argument("--mute-audio")

driver = webdriver.Chrome(chrome_options = options)
driver.get(link)

Hope this helps you!

Moshe Slavin
  • 5,127
  • 5
  • 23
  • 38