Turning off logging in Selenium (from Python)

前端 未结 4 823
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 19:16

I\'ve recently inherited some Selenium Webdriver code, written in Python 2.7. It is logging copious amounts of data to /tmp on Ubuntu - so much that it is becoming a problem

4条回答
  •  孤城傲影
    2020-11-27 19:42

    Here's what helped me to overcome the problem:

    import logging
    from selenium.webdriver.remote.remote_connection import LOGGER
    LOGGER.setLevel(logging.WARNING)
    

    Note: this code should be put before webdriver initialization.

    Hope that helps.

提交回复
热议问题