how to get all hyperlinks from a website code example
Example 1: all links in web page
All the link TagName should be "a".
I locate the webelements starts with tagname "a".
I also use driver.findElements instead of driver.findElement since the
list of webelements will return.
List <WebElement> list = driver.findElements(By.tagName(a))
Example 2: extract all link with javascript
$(document).ready(function(){
$('a').each(function(){
console.log($(this).attr('href'));
});
});