Not all xpath expressions can be translated to CSS-like selectors or do not work efficiently. You can use the :eq
selector to access items by index, but it is recommended that you use the eq
method instead. This will be equivalent to xpath in your example:
$('html > body > div > a').eq(3).each( ...
source share