Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Python在Selenium中禁用Chrome无头日志(每天1TB)_Python_Selenium_Selenium Webdriver_Selenium Chromedriver - Fatal编程技术网

使用Python在Selenium中禁用Chrome无头日志(每天1TB)

使用Python在Selenium中禁用Chrome无头日志(每天1TB),python,selenium,selenium-webdriver,selenium-chromedriver,Python,Selenium,Selenium Webdriver,Selenium Chromedriver,我遇到了一个非常奇怪的问题。我正在使用selenium和python运行15个Chrome headless。在我的全新nvme硬盘上,一切都运行良好 除了一个大问题:chrome实例每天在我的nvme上累计写入1TB的数据。日志文件没有存储(我的意思是我找不到它们,我的磁盘只有250GB),但根据iotop和smart monitoring,它们被写入磁盘 我尝试使用多个解决方案禁用日志(重定向到/dev/null,仅为错误启用日志记录器),但我无法停止驱动器上的大量IO。我甚至不确定我是否来

我遇到了一个非常奇怪的问题。我正在使用
selenium
和python运行15个Chrome headless。在我的全新nvme硬盘上,一切都运行良好

除了一个大问题:chrome实例每天在我的nvme上累计写入1TB的数据。日志文件没有存储(我的意思是我找不到它们,我的磁盘只有250GB),但根据iotop和smart monitoring,它们被写入磁盘

我尝试使用多个解决方案禁用日志(重定向到/dev/null,仅为错误启用日志记录器),但我无法停止驱动器上的大量IO。我甚至不确定我是否来自日志,但我在我的Google Chrome实例上有写活动,我不知道它可能是什么

您知道如何减少磁盘上的写入活动吗?


谢谢

您是否为chrome webdriver尝试了这些功能

capabilities = webdriver.DesiredCapabilities().CHROME
capabilities["goog:loggingPrefs"] = {"browser": "WARNING", "driver": "WARNING", "performance": "WARNING"}
driver = webdriver.Chrome(desired_capabilities=capabilities)

谢谢你的回答。我会尽快尝试