Evaluate XPath to find elements in the page

Help us make DevTools Tips better! Fill out this survey to tell us more about your DevTools habits and frustrations.

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:

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');

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

See also