![How to clear google chrome browser cache](https://knopkazmeya.com/1.png)
Unfortunately, this won’t work because the Chrome settings page uses Polymer and WebComponents. Your first thought might be that you can call driver.find_element_by_id('clearBrowsingDataConfirm').click() here to find the DOM element and click it. We can see that the button’s id is clearBrowsingDataConfirm. This will highlight the button element and allow us to find its id. We can right click on the button and then click on “Inspect” to open the Chrome Developer Tools. Then it’s just a matter of clicking the “CLEAR BROWSER DATA” button to actually clear the cache. You can navigate to this same page with Selenium by executing driver.get('chrome://settings/clearBrowserData'). If you navigate to chrome://settings/clearBrowserData in a Chrome browser then you’ll see something that looks like this. Luckily, if you get a bit creative then you can accomplish the same thing by using Selenium to interact with Chrome’s setting interface. The functionality to clear the cache directly is unfortunately not built into the WebDriver specification.
![how to clear google chrome browser cache how to clear google chrome browser cache](https://www.droidviews.com/wp-content/uploads/2018/12/clear-cache-data-chrome-android-01.jpg)
![how to clear google chrome browser cache how to clear google chrome browser cache](https://i1.wp.com/info1.net/wp-content/uploads/2021/01/How-to-clear-the-cache-of-your-Google-Chrome-browser.jpg)
There are however times when this method loses other state that you may want to preserve. The fresh instance of Chrome will start with a clean browser history, cookies, and cache. You can of course call driver.close() on your current ChromeDriver instance and then provision a new one.
![how to clear google chrome browser cache how to clear google chrome browser cache](https://www.gudtechtricks.com/wp-content/uploads/2020/07/Clear-the-Browser-Cache-in-Google-Chrome.jpg)
Sometimes during the course of testing or web scraping with Google Chrome, you might desire to clear the browser cache and cookies with Selenium.
![How to clear google chrome browser cache](https://knopkazmeya.com/1.png)