Answer the question
In order to leave comments, you need to log in
Unable to find element by xpath using selenium. Any thoughts?
Faced the following problem. You need to find the element and click on it. The problem is the following: the web is built on Ember.js, so each element has a dynamic id. I tried to find an element by text in the class, but it still fails.
part of the website code:
<a href="javascript:void(0)" class="link" data-ember-action="" data-ember-action-574="574">Зарегистрироваться</a>
registration = browser.find_element_by_xpath('//*[@class='link' and text()='Зарегистрироваться']').click()
Answer the question
In order to leave comments, you need to log in
//*[contains(@class, "link")][contains(text(), "Зарегистрироваться")]
Today they brought an article to Habr, look, it can help - XPath functions for dynamic XPath in Selenium
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question