How can we find all the links on a web page?

How can we find all the links on a web page?

Hello Rhian-lewis,

All the links are of anchor tag ‘a’. So by locating elements of tagName ‘a’ we can find all the links on a webpage.

List<WebElement> links = driver.findElements(By.tagName("a"));