Chrome supports the document.evaluate
function which can select elements by XPath.
The signature:
var xpathResult = document.evaluate(
xpathExpression,
contextNode,
namespaceResolver,
resultType,
result
);
In your case this will be
var expr = "/html/body/table/tbody/tr/td/table[2]/tbody/tr/td[3]";
var td = document.evaluate(expr, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
You can also use XPathResult.UNORDERED_NODE_ITERATOR_TYPE
to get a list of nodes through an iterator.
Edit: You can also use the transform the XPath to a CSS3 selector and use document.querySelector
:
var expr = "body > table > tbody > tr > td > table:nth-of-type(2) > tbody > tr > td:nth-of-type(3)";
var td = document.querySelector(expr);