Selecting elements whose attribute begins with something in XPath Selecting elements whose attribute begins with something in XPath java java

Selecting elements whose attribute begins with something in XPath


Not sure if this is exactly the correct syntax but you probably want to use the fn:contains xpath function. Other useful functions you can find here:

http://www.w3schools.com/xpath/xpath_functions.asp#string

getByXPath("//a[fn:contains(@href/text(), 'buy.php/')]")