XPATH: locate child element

Last updated on:

Here is how to to locate child element using xpath:

//div[contains(@class,'some_class')]/child::div

In one of my projects I have really intersting situation, when I was able to locate first row in a table, but I was need to get all rows. In order to perform it, I located element on first child, then moved it to parent, and from parent grabbed all child divs:

//div[contains(@class,'x-grid3-row-first')]/parent::div/child::div


        
			
View Comments

Leave a Comment

Use markdown or basic HTML and be nice.