I have a situation where I need to retrieve values from a array of article
's, but I'm not very successful. My HTML looks like this:
<section class="list">
<article class="card">
Article by Bigown
</article>
<article class="card">
Article by Bacco
</article>
<article class="card">
Article by Wallace
</article>
<article class="card">
Article by Guilherme
</article>
<article class="card">
Article by Marcelo
</article>
</section>
Using JAVA, I can only capture the value of the first <article>
passing the class, but I can not get the next ones because the classes have the same names. See:
WebElement txtArticle;
txtArticle = driver.findElement(By.className("card"));
System.out.print(title.getText());
Return for the above code:
Article by Bigown
As I wanted to return:
Article by Bigown
Article by Bacco
Article by Wallace
Article by Guilherme
Article by Marcelo
How can I redeem the values of every article
even containing equal classes using Selenium?