How do I relocate/disable GeckoDriver's log file in selenium, python 3?

前端 未结 6 1824
执笔经年
执笔经年 2021-01-02 06:14

Ahoy, how do I disable GeckoDriver\'s log file in selenium, python 3?

If that\'s not possible, how do I relocate it to Temp files?

6条回答
  •  时光取名叫无心
    2021-01-02 06:49

    ref: 7. WebDriver API > Firefox WebDriver

    according to the documents, you can relocate it to Temp following:

    from selenium import webdriver
    from selenium.webdriver.firefox.options import Options$
    import os
    
    options = Options()
    driver = webdriver.Firefox(executable_path=geckodriver_path, service_log_path=os.path.devnull, options=options)
    

    Following argument are deprecated:

    • firefox_options – Deprecated argument for options
    • log_path – Deprecated argument for service_log_path

提交回复
热议问题