Python Selenuim

Clear browsing history, cookies of chrome browser via selenium using python

Written by Deep

Sometimes the fresh instance of Chrome will need to start with a clean browser history, cookies, and cache while working with selenium in python. I found this method working 100% with updated chrome browser.

The magic function

Function to clear chrome browser cache:

This clear_cache(driver) method will clear the browsing data in the same way that a user would. If you execute it, by using

How to use?

Just create python file or add in existing file as per your requirements:

Thus, you will be able to clear browsing history, cookies and other stuff of chrome browser.

Leave a Comment