I use selenium with Scrapy and it produces way too much logs.
I tried several solutions offered at SO before but none of them worked.
Basically I tried disabling it in
options
and passing service-argument
to write log into file. In both cases the log is still printed while executed. How do I fix it?
options = Options()
options.headless = True
# options.add_argument('--disable-logging')
self.driver = webdriver.Chrome(r'C:\Python3\selenium\webdriver\chromedriver_win32\chromedriver.exe', chrome_options=options, service_args=["--verbose", "--log-path=D:\\qc1.log"])
I also tried settings service-path to NULL
(I run windows)
self.driver = `webdriver.Chrome(r'C:\Python3\selenium\webdriver\chromedriver_win32\chromedriver.exe', chrome_options=options, service_log_path='NUL')`
SOLUTION: Thanks to - @Manmohan_singh and The only working answer so far add this
chrome_options.add_argument("--log-level=3") to shut the logging.
self.driver = webdriver.Chrome(r'C:\Python3\selenium\webdriver\chromedriver_win32\chromedriver.exe', chrome_options=options)
Hope this will be useful in future, since none of the presumably duplicate topics did help me and Stack moderators do not seem to read the posts carefully.