Hey Karthik,
XPath uses path expressions to select nodes in an XML/HTML document. The node is selected by following a path or steps.
The useful path expressions are listed below:
Expression |
Description |
nodename |
Selects all nodes with the name "nodename" |
/ |
Selects from the root node |
// |
Selects nodes in the document from the current node that matches the selection no matter where they are |
. |
Selects the current node |
.. |
Selects the parent of the current node |
@ |
Selects attributes |
Example -
/div/span/#id_name/.class_name
You can find examples and explanation here,
https://www.w3schools.com/xml/xpath_examples.asp