
XPath Cheat Sheet: Guide with Examples
XPath is a query language for navigating XML and HTML documents. It has a small core and a large number of ways to misuse it. This is a reference organised the way you actually need it: syntax first, then the functions worth knowing, then the patterns that come up repeatedly, then the traps. Everything here is XPath 1.0, which is what browsers, Selenium and most parsing libraries implement.

