samedi 27 août 2016

Selenium: selecting all inner elements

I select all <a> elements inside all <td> elements

<td class="thread">
    <i class="ter green"></i>
    <a href="/forum/threads/12/">Something about...</a>
    <p class="info">Author</p>
</td>

I use the following:

driver.findElements(By.cssSelector("td.thread a"));

However, I'm getting much more elements than there are on the page. What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire