XPath
XPath is a W3C language for navigating and selecting nodes in XML and other structured document trees.
BDD in Action, Second Edition
An XPath expression is a path query that selects nodes in a structured document such as an HTML or XML document.
- How it is used
- Locates HTML elements for WebDriver acceptance tests when their position, attributes, or text provide the useful identifier.
- How deep it goes
- Explains common expressions through WebDriver calls and element examples, without developing XPath beyond the patterns needed for page interaction.
- Examples
- Uses destination titles and prices, a welcome heading, and registration preference labels as selection targets.
- What you can do after
- Apply it via WebDriver `By.xpath()` to find elements by attributes or text and navigate to related elements.
Practical Automation with PowerShell: Effective scripting from the console to the cloud
An XPath query is an expression defined by the XPath language for selecting nodes in an XML or HTML document tree.
- How it is used
- Extracts Microsoft Update Catalog search and detail-page data during PowerShell web scraping.
- How deep it goes
- Demonstrates browser-assisted query design, SelectNodes, SelectSingleNode, and nested-element traversal without teaching XPath language syntax broadly.
- Examples
- Uses Microsoft Update Catalog KB4521858 results, dynamic link ids, architecture, supported products, and supersedence links.
- What you can do after
- Apply it via PowerHTML to select result links and detail-page values from converted HTML.
100 SQL Server Mistakes and How to Avoid Them
XPath is a W3C language for navigating and selecting nodes in an XML document.
- How it is used
- Navigates XML hierarchies to select rows and map parent values during SQL Server OPENXML() shredding.
- How deep it goes
- Defines navigation, row selection, and ../ traversal but stops short of broader XPath syntax.
- Examples
- Uses nested employee, contract, and skill XML with upward ../ mappings.
- What you can do after
- Apply it via OPENXML() to select XML rows and retrieve values from higher hierarchy levels.
Read how 100 SQL Server Mistakes and How to Avoid Them explains XPath →
Related concepts
- CSSalternative to · CSS, or Cascading Style Sheets, is a stylesheet language for specifying the presentation and layout of structured documents and user interfaces.
- CSS selectoralternative to · A CSS selector is a pattern that identifies document elements by their names, attributes, relationships, states, or other conditions.
- JSON path languagecontrasts with · JSONPath is a query language and expression syntax for navigating, selecting, and extracting values from hierarchical JSON documents.
- Page Element Query Languagealternative to · The Page Element Query Language is Serenity/JS's portable query syntax for locating page elements and deriving information from them.
- xmluses · XML is a text-based markup language for encoding structured documents and data using elements, attributes, and nested relationships.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


