driver为chrome驱动
清除缓存时需要逐层切入shadowRoot中获取相应的标签
def clear_stash(driver):
driver.get("chrome://settings/clearBrowserData/")
time.sleep(2)
out_window = expand_shadow_element(driver.find_element_by_tag_name("settings-ui"), driver)
out_window = expand_shadow_element(out_window.find_element_by_id("main"), driver)
out_window = expand_shadow_element(out_window.find_element_by_tag_name("settings-basic-page"), driver)
out_window = expand_shadow_element(out_window.find_element_by_tag_name("settings-privacy-page"), driver)
out_window_final = expand_shadow_element(out_window.find_element_by_tag_name("settings-clear-browsing-data-dialog"),
driver)
out_window = expand_shadow_element(out_window_final.find_element_by_id("clearFromBasic"), driver)
out_window_button = out_window_final.find_el