I want to access a website but I just can't get the cookie pop up to go away. The website itself opens but I can't seem to grab the accept button for the cookie. Here is my code thus far:
#set path, open firefox
path = r'C:\Users\Anwender\Downloads\geckodriver-v0.30.0-win64\geckodriver.exe'
driver = webdriver.Firefox(executable_path=path)
#open bym forum
driver.get('https://www.bym.de/forum/')
#deal with the effing cookie message
wait = WebDriverWait(driver,15)
wait.until(EC.presence_of_element_located((By.XPATH, '/html/body/div[4]/div[2]/div/div/div/div/div/div/div[2]/div[2]/button[2]/span'))).click()
#log in
username = driver.find_element_by_id("navbar_username")
password = driver.find_element_by_id("navbar_password")
username.send_keys("my_username")
password.send_keys("my_password")
driver.find_element_by_xpath("/html/body/div[1]/div[2]/main/div[3]/div[1]/ul/li[2]/form/fieldset/div/div/input[4]").click()
The log in code I included to mention that I have used the exact same syntax to log into a different website so I am not sure how to get past this. The html code of the cookie button "accept" (here: "Zustimmung") is:
<button title="Zustimmen" class="message-component message-button no-children focusable button global-font-headline sp_choice_type_11 last-focusable-el" style="padding: 14px 40px 12px; margin: 12px 0px; border-width: 1px; border-color: rgb(102, 102, 102); border-radius: 20px; border-style: solid; font-size: 12px; font-weight: 700; color: rgb(17, 17, 17); font-family: georgia, serif; width: calc(100% - 80px); background: rgb(255, 255, 255) none repeat scroll 0% 0%;">Zustimmen</button>
I have tried to grab the button by css path or by name as well but I just have no idea why it doesn't work. :/