I have two buttons on a page containing "Einloggen" text and I need to click the "Einloggen" button.
The first element with "Probleme beim Einloggen?" is a link with span.
and the second, which I need is a button with a span.
CSS classes are not stable, I cannot use them.
I have tried:
self.log_in_link = WebDriverWait(self.driver, self.delay).until(
EC.presence_of_element_located((By.XPATH, "//button/following-sibling::span[contains(text(), 'Einloggen')]")))
But it can't find it
If I try so
self.log_in_link = WebDriverWait(self.driver, self.delay).until(
EC.presence_of_element_located((By.XPATH, ".//span[contains(text(), 'Einloggen')]")))
The driver clicks the wrong element ("Probleme beim Einloggen?")


