I am writing on a selenium program to scrape a site that is behind a login. However everything except the Placeholder text is dynamic including the css selectors, the xpath etc. Is there a way to select by visible text without Xpath?
html snippet:
<form class="un-form un-login-form "><div class="un-login-form__change-school form-group">Name<br><small>D-26871, Russellstr. 33</small><br><a>Schule wechseln</a></div><div class="form-group"><input type="text" value="" placeholder="Benutzer" id="732de780-8f7b-41f6-98ba-c73503c93fcc" class="form-control"></div><div class="form-group"><input type="password" value="" placeholder="Passwort" id="5d7bc08a-7301-4348-82f1-a16e9e657720" class="form-control"></div><div class="un-login-buttons un-login-form__buttons btn-group"><button type="submit" title="Login" class="btn btn-primary">Login</button></div><div class="un-login-form__links"><a>Passwort vergessen?</a><br></div></form>
my code:
paswd = driver.find_element_by_xpath("//input[@placeholder='Passwort']")
So due to the variing xpath i always get the error not found also due to the classes all named the same it cant focus the element