What is XPath?

DefinitionXPath (XML Path Language) is a query language defined by the W3C for selecting parts of XML documents and HTML pages, such as elements, attributes and text.

Also known as XML Path Language

XPath became a W3C Recommendation in 1999 and is used by XSLT, XQuery and many programming libraries. An XPath expression describes a path through a document's tree, such as //h1 to select every h1 heading, and it can filter by attributes, position or text content.

Browsers support XPath through the document.evaluate() method and in developer tools, and it's widely used for web scraping, automated testing and SEO crawlers that extract data like titles, prices or structured data from pages. Site monitoring and crawling tools often let users write custom XPath rules to check HTML pages for specific elements.

XPath resources

Topics: Web development, Web standards and protocols

Cite this definition
APA

What is XPath? (2026, November 22). Glossary. https://glossary.io/xpath/

MLA

“What Is XPath?” Glossary, Coywolf, 22 Nov. 2026, glossary.io/xpath/.

Chicago

“What Is XPath?” Glossary. Coywolf. November 22, 2026. https://glossary.io/xpath/.

HTML link
<a href="https://glossary.io/xpath/">What is XPath?</a>

Published