How to find an element by partial href?

Viewed 4956

How can I locate that element with xpath? (class name is not unique).

<a class="my-action" href="/my/path/page.html"></a>

Tried: //a[@href='/my/path/page.html'] but did not succeed. What is wrong?

2 Answers

example = browser.find_element_by_class_name("my-action"[href*='my']")

Related