Java Selenium, how to get linkText (anchor) from link WebElement
If getText() returns an empty String, try the innerHTML attribute:
String text = element.getAttribute("innerHTML")
Try this:
System.out.println(link.getText());
If getText() returns an empty String, try the innerHTML attribute:
String text = element.getAttribute("innerHTML")
Try this:
System.out.println(link.getText());