I'm trying to accept cookies with Selenium, but the accept button is not found. I am not familiar with Selenium and I don't know how to debug. For instance, if I try to accept cookies from webrankinfo.com.
This is my code:
driver = webdriver.Chrome("chromedriver")
driver.get("https://www.webrankinfo.com")
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//span[normalize-space()='Tout accepter et continuer']"))).click()
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//span[contains(., 'Tout accepter et continuer')]"))).click()
Whatever the selected option (Xpath or CSS), the button is not found. What is the solution?
Moreover, is there any option to debug Xpath directly on my Web Browser like Chrome or Firefox?
EDIT :
Because most people can't see the cookie banner, I share the original cookie framework used. I think you can't see banner because it's not obligated when you're not in Europe.
You can force banners to appear by going to https://www.consentframework.com/#/ and clicking on Gérer vos préférences
(green button) on top right.