Iterator<WebElement> itr = allLinks.iterator(); while(itr.hasNext()) { System.out.println(itr.next().getText()); }