XPath Tester

使用浏览器 document.evaluate 在本地 HTML 文档上匹配节点。

What Is an XPath Tester?

An XPath tester is an online tool for evaluating XPath expressions using the browser's built-in document.evaluate engine against local HTML. It lists the matched nodes, attributes, and text, as well as number, string, and boolean results. It's ideal for debugging XPath selectors used in scrapers, data extraction, or front-end automation scripts.

Main Features

  • Evaluates with the native browser XPath engine and supports the full XPath syntax
  • Shows results by type: elements, attributes, text nodes, and number/string/boolean values
  • Lists every match, truncating content over 300 characters
  • Built-in example expression with one-click fill and copy

Use Cases / Notes

Great for debugging web scraping rules, verifying front-end automation selectors, or learning XPath syntax. Note that the tool parses the HTML you paste locally and does not visit external sites; an invalid expression shows an "invalid XPath" message.

How to Use

  1. Paste HTML content into the input box
  2. Enter an XPath expression (e.g. //a/@href)
  3. Click "Match" to review the node list and result types, then copy with one click