python selenium清除缓存_SeleniumPython:无法清除chrome浏览器缓存
我正在尝试清除chrome浏览器缓存,方法是在导航到后单击下面的“清除数据”按钮chrome://settings/clearBrowserData。但我无法点击“清除数据”按钮。请告知。在我正在使用:操作系统:Win 10 pro 64位python版本:3.6.1Chrome版本:74.0.3729.169(官方版本)(64位)def clear_current_session(self):#
我正在尝试清除chrome浏览器缓存,方法是在导航到后单击下面的“清除数据”按钮chrome://settings/clearBrowserData。但我无法点击“清除数据”按钮。请告知。在
我正在使用:
操作系统:Win 10 pro 64位
python版本:3.6.1
Chrome版本:74.0.3729.169(官方版本)(64位)def clear_current_session(self):
# Opens a new tab
self.driver.execute_script("window.open()")
# Switch to the newly opened tab
self.driver.switch_to.window(self.driver.window_handles[1])
# Navigate to new URL in new tab
self.driver.get("chrome://settings/clearBrowserData")
#Click on the Clear data button
self.driver.find_element_by_css_selector("* /deep/ #clearBrowsingDataConfirm").click()
self.driver.implicitly_wait(60)
# Switch to original tab
self.driver.switch_to.window(self.driver.window_handles[0])
更多推荐
所有评论(0)