How to get total no of links on Web page?

rencontres arles book award How to get total no of links on Web page?

website here Step to follow…
1) Navigate to the interested webpage for e.g.
2) Create a list of type WebElement to store all the Link site elements in to it.
3) cafam citas via web Collect all the links from the webpage. All the links are associated with the Tag ‘ click here to read a‘.
4) Now iterate through every link and print the this hyperlink Link Text on the console screen. package pack2; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class Program1 { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); driver.manage().window().maximize(); driver.get(""); java.util.List<WebElement> links = driver.findElements(By.tagName("a")); System.out.println(links.size()); for (int i = 1; i<=links.size(); i=i+1) { System.out.println(links.get(i).getText()); } driver.quit(); } }

a fantastic read This Program will display the Total Numbers of links on the webpage and will display all the names of the links.