Java hyperlink readtext
I'm trying to read the name from a hyperlink and use the name to comp开发者_运维百科are with another for verification.
EDIT: This is what i currently have
String linkText = ####;
for(int i = 0; i < objs.length; i++) {
ArrayList<String> options = new ArrayList<String>();
options.add("nameLink");
options.add("nameLink");
options.add("nameLink");
options.add("nameLink");
options.add("nameLink");
if (options.contains(linkText))
What i want is to get the name of the hyperlink ALink = www.link.com so i want ALINK to be sent to linkText to compare if the name is the same.
If you meant that you have two URL's, then you can use the URL.toString()
method, and then compare the two Strings using String.equals()
.
精彩评论