John C is the closest, but XPath is case sensitive, so the correct XPath would be:
/bla/a[contains(@prop, 'Foo')]
descendant-or-self::*[contains(@prop,'Foo')]
Or:
/bla/a[contains(@prop,'Foo')]
Or:
/bla/a[position() <= 3]
Dissected:
descendant-or-self::
The Axis - search through every node underneath and the node itself. It is often better to say this than //. I have encountered some implementations where // means anywhere (decendant or self of the root node). The other use the default axis.
* or /bla/a
The Tag - a wildcard match, and /bla/a is an absolute path.
[contains(@prop,'Foo')] or [position() <= 3]
The condition within [ ]. @prop is shorthand for attribute::prop, as attribute is another search axis. Alternatively you can select the first 3 by using the position() function.
If you also need to match the content of the link itself, use text():
//a[contains(@href,"/some_link")][text()="Click here"]