我正在尝试清除我的Firefox浏览器中的缓存和cookie,但我无法让它工作.我已经搜索过了,我只获得了java和C#的解决方案.如何清除Python中的缓存和cookie?
硒版本:3.6.0
平台:python
python版本:2.7.8
webdriver:geckodriver
浏览器平台:Firefox
在我的应用程序中,我需要一种方法在注销之前仅清除chrome浏览器的缓存(除了cookie - 我不想删除cookie).
任何人都可以建议我点击chrome中的CLEAR DATA按钮.我写了下面的代码,但代码不起作用.
配置:
Chrome版本:65.0.3325.181版(官方版)(64位)
Selenium版本:3.11.0
//Clear the cache for the ChromeDriver instance.
driver.get("chrome://settings/clearBrowserData");
Thread.sleep(10000);
driver.findElement(By.xpath("//*[@id='clearBrowsingDataConfirm']")).click();
Run Code Online (Sandbox Code Playgroud)