I am using find_link_dom and it's working... to find the first link that matches. I need to find the second. Here is my line:
my $link = $mech->find_link_dom ( text_regex => 'abc' );
Is there a way for this command to return the second link that matches?
And before someone comment that I need to change my search criteria, the text is the same. The only thing different is the url and I don't know just from the url which should be picked. I need the second link that match the above search.
The documentation says it returns objects. That's plural. There is also this piece of code. Note the
for.So you can just call it in list context to get all the found links, or just take the one you want.
That should give you the second one.
Alternatively, grab all of them and output, to see what's going on.
Or, you can use the option
n, which is a 1-based index.