DevTools Tips

Categories: Supported by:

Evaluate XPath to find elements in the page

DevTools supports 2 ways to evaluate XPath expressions to help you locate elements in the page. All browsers support those 2 ways:

Screenshot of the Inspector panel in Firefox showing the search field with an XPath expression

Note that you can also copy the XPath expression from any element in DevTools.

$x('//div/div/label');

Screenshot of the Console panel in Safari showing an array of elements, as the result of executing the above function