XPath
XPath is a query language for selecting nodes from an XML or HTML document tree.
Web scraping tools use XPath expressions to target specific elements in the DOM — for example, `//div[@class="price"]` selects all div elements with class "price". XPath is an alternative to CSS selectors.
Related Terms
CSS Selector
A CSS selector is a pattern used to select HTML elements by their tag, class, ID, attribute, or structural position.
Web Scraping
Web scraping is the automated extraction of structured data from websites.
HTML Parser
An HTML parser reads raw HTML text and converts it into a structured tree of nodes (the Document Object Model, or DOM) that programs can traverse and query.