Python Selenium Safari, disable logging
It looks like from the Safari webdriver.py you can pass quiet
boolean argument that's passed to service object in the service.py and all stdout and stderr would go to /dev/null
kwargs = dict()if self.quiet: devnull_out = open(devnull, 'w') kwargs.update(stdout=devnull_out, stderr=devnull_out)
From your code above just change this:
browser = webdriver.Safari()
to this:
browser = webdriver.Safari(quiet=True)
I use -D
to pass the VM arg and write debbug of Selenium in a new file.
e.g. java -jar -Dselenium.LOGGER=log.txt selenium-server-standalone-2.44.0.jar
I've found an answer at the Selenium user forums for the Java driver:
if (driver instanceof RemoteWebDriver) { ((RemoteWebDriver) driver).setLogLevel(Level.WARNING); }
Using this commands just after creating the driver object solved my log verbosity problem. Maybe you can adapt it for Python.