XPath Tester
Test XPath expressions against XML or HTML. Live evaluation, results highlighted. Supports XPath 1.0. Runs 100% in your browser.
Results
No matches.
Reference
What is XPath?
XPath is a query language for selecting nodes from XML and HTML documents. This tool uses your browser's native document.evaluate() implementation, which supports XPath 1.0. Common operators: / (root or step), // (descendant), . (current), .. (parent), @ (attribute), [predicate] (filter), | (union).
Common patterns
//div[@class="hero"]— every div with class "hero".//a[@href]— every link with an href.//ul/li[1]— first list item under each ul.//*[contains(text(), "hello")]— any element whose text contains "hello".//table//tr[position() > 1]— all rows except the header.
Common uses
- Web scraping — write XPath selectors for tools like Scrapy, Puppeteer, Playwright.
- XML processing — query config files and SOAP responses.
- Test automation — find elements in Selenium/WebDriver tests.
Privacy
All evaluation runs 100% in your browser. No data is sent to any server.