Free XPath Tester
Test XPath expressions online against HTML. Find matching nodes, extract attributes, and evaluate string, number, or boolean results with this free XPath tester.
Loading tool…
How it works
Provide the HTML
Paste an HTML document or fragment, or load the example. The tester evaluates expressions against an inert HTML document with html and body elements.
Evaluate an expression
Try //a/@href to read link attributes, //table//tr to match rows, or count(//a) for a scalar result. Node results appear in document order.
Copy the results
Export node values and source snippets as JSON. String, number, and boolean results can be copied or downloaded as text. Node queries also include a Playwright locator example.
Which XPath version is used?
The tester uses your browser’s XPath 1.0 implementation. XPath 2.0 functions and custom namespace bindings are not supported. For HTML elements, use lowercase tag names in expressions.
XPath or CSS selectors?
CSS selectors are convenient for matching elements by class or attribute. XPath can also select attributes and text nodes, navigate to ancestors, and calculate values. Choose the expression that describes the structure you actually have.
Run your extraction with Playwright.
Connect your own Playwright code to Browser Use and collect data from managed browsers.