![Selenium WebDriver Quick Start Guide](https://wfqqreader-1252317822.image.myqcloud.com/cover/282/36699282/b_36699282.jpg)
What is the DOM?
The DOM is an application programming interface that is linked to HTML, XHTML, or XML documents and treats these similar to a tree where each node in the tree represents a part of the document.
In simple words, the DOM can be compared to a tree where there is a root node, intermediate nodes, and leaf nodes.
Shown here is a sample DOM:
![](https://epubservercos.yuewen.com/D05A6A/19470386908849106/epubprivate/OEBPS/Images/0af65b38-823b-401f-b0d3-7ba4ee206cc7.png?sign=1738854895-y6nwyZKxtoWyTRcUltrSpf7P3W8T43Gs-0-9fc74099cb0abda913424b64b4711fa0)
In the preceding diagram, there are three leaf nodes, two intermediate nodes, and one root node. All of this is contained in a document. The question that arises next is: how do we get to a particular node in this tree structure? This is where terms such as XPath and CSS come into picture.
XPath stands for XML Path and is a querying language to query the nodes in a DOM.
CSS stands for Cascading Style Sheets and is a style sheet language used for describing the look and format of a document written in any markup language.