Reputation: 83
Can anybody please tell me what is the difference between // and //* in xpath. Is there any difference?
Upvotes: 0
Views: 444
Reputation: 96
//div[@id='xyz'] means find all div-s with the mentioned if ,// means that it is an relative Xpath and not an absolute one.
//*[@id='xyz'] find all element with the mentioned id not just div.Again it is an Relative Xpath as it starts with //
Upvotes: 0
Reputation: 2703
"//div[@id='something']"
- will find the div with id something.
"//*[@id='something']"
- will find any tag with id something.
Upvotes: 2
Reputation: 616
Source-Xpath Syntax
//* Selects all elements in the document
// Selects nodes in the document from the current node that match the selection no matter where they are
Upvotes: 0