I have table which have several <td>
tags, again these tag have nested
<div>
tag. But the number of <div>
are dynamic. Means, for each <td>
tag number of <div>
are different.
I wanted to find the total number of <div>
inside a <td>
and iterate them to grab each div's value.
I've tried using below xpath, but I'm not sure how can I get the count of <div>
's for loop through them.
for(int i=1;i<=NoOfDivs;i++)
{
WebElement NestedDivs= driver.findElement(By.xpath("/html/body/table[4]/tbody/
tr[3]/td[2]/div["+i+"]"));
}
Webpage HTML is given in the below snap: