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

Menace picture Menace · May 1, 2018 · Viewed 9.7k times · Source

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?

Answer

DebanjanB picture DebanjanB · May 1, 2018

To relocate the GeckoDriver logs you can create a directory within your project space e.g. Log and you can use the argument log_path to store the GeckoDriver logs in a file as follows :

from selenium import webdriver

driver = webdriver.Firefox(executable_path=r'C:\path\to\geckodriver.exe', log_path='./Log/geckodriver.log')
driver.get('https://www.google.co.in')
print("Page Title is : %s" %driver.title)
driver.quit()