Turning off logging in Selenium (from Python)

前端 未结 4 834
被撕碎了的回忆
被撕碎了的回忆 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:36

    import logging
    selenium_logger = logging.getLogger('selenium.webdriver.remote.remote_connection')
    # Only display possible problems
    selenium_logger.setLevel(logging.WARNING)
    

提交回复
热议问题