I want to access an website with selenium and than a addblock-window appears, in which i need to click a button for it to disappear.
Eventhough I can find my XPath(//button[@title='Einverstanden']
, /html/body/div/div[2]/div[3]/div[1]/button[@title = 'Einverstanden']
or
//button[contains(text(),"Einverstanden")]'
) in the browser,
I can't find it with my Python script. And i can't seem to find the mistake.
Here is my code.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Firefox()
driver.implicitly_wait(30)
driver.get("``https://www.derstandard.at/story/2000134260361/endspiel-vor-gericht-prozess-gegen-boris-becker-startet-in-london``")
driver.maximize_window()
x = driver.find_element(By.XPATH, "//button[@title = 'Einverstanden']")
print(x)
This is the error I'm getting.