First of all, I don't think your "finetuning" did the best possible job. An element id
should be unique in the document and is therefore usually cached by modern browsers (which means that id lookup is instant). You can help the XPath engine by using the id()
function.
Therefore, the XPath expression would be: id('T_I:3')/span/a
(yes, that's a valid XPath 1.0 expression).
Anyway, to convert this to CSS, you'd use: #T_I:3 > span > a
Your "finetuned" expression converted would be: div#Overview #T_I:3 > span > a
, but seriously, you only need one id
selection.
The hashtag #
is an id
selector.
The space (
) is a descendant combinator.
The >
sign is a child combinator.
EDIT based on a good comment by Fréderic Hamidi:
I don't think #T_I:3
is valid (the colon would be confused with the
start of a pseudo-class). You would have to find a way to escape it.
It turns out you also need to escape the underscore. For this, use the techniques mentioned in this SO question: Handling a colon in an element ID in a CSS selector.
The final CSS selector would be:
#T\5FI\3A3 > span > a