
Also, his Tabs weren't mapping to the right places for me so I made some edits for it to work in 2022 (on mine at least). I used a similar method to answer but made it a bit more functional. In any doubt, go to chrome://settings/, click on the browser data/cache clearing section and copy the new term. The old version was chrome://settings/cleardriverData. UPDATE 01/2021: Apparently the settings section in chromedriver is subject to change. from _chains import ActionChainsįrom import Keysĭriver = webdriver.Chrome("path/to/chromedriver.exe")ĭriver.execute_script("window.open('') ")ĭriver.switch_to.window(driver.window_handles)ĭriver.get('chrome://settings/clearBrowserData') # for old chromedriver versions use cleardriverDataĪnd_keys(Keys.TAB * 3 + Keys.DOWN * 3) # send right combinationĪnd_keys(Keys.TAB * 4 + Keys.ENTER) # confirmĭriver.switch_to.window(driver.window_handles) # switch back

Use this function which opens a new tab, choses to delete everything, confirms and goes back to previously active tab. Cache clearing for Chromedriver with Selenium in November 2020:
