我正在尝试清除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])
本文介绍了一段用于自动清除Chrome浏览器缓存的Python脚本。该脚本使用Selenium库打开设置页面并尝试点击“清除数据”按钮,但遇到了按钮无法点击的问题。文章详细记录了操作步骤及使用的软件版本。

977

被折叠的 条评论
为什么被折叠?



