As the title says, is it possible to select elements in XPath that only begin with a certain string, but perhaps do not end with the same?
For example there are 3 an
//a[starts-with(@href, 'buy.php/')]
http://www.zvon.org/xxl/XSLTreference/Output/function_starts-with.html
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/')]")