我正在尝试单击 cookie 条款弹出窗口中的按钮“选择所有 cookie”。 我试过:
div=driver.find_element(By.XPATH,'//*[@id="js_cookie-settings-modal"]/div[2]/div/div[3]/div')
driver.implicitly_wait(4)
button=div.find_element(By.XPATH,'//*[@id="selectAll"]')
driver.implicitly_wait(4)
button.click()
错误:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
(Session info: chrome=111.0.5563.64)
选项2:
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="selectAll"]'))).click()
driver.implicitly_wait(50)
错误:
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: