my $result = $a->get($start_page);
#open PAGE, ">top.html" or die "Could not open top.html:$!\n";
#print PAGE $result->as_string;
#close PAGE;
#die "PAGE written\n";
my $link = $a->find_link(text => 'Login')
or die "Found no Login link\n";
The file contained this line, which is what I expected the find_link to return, but it did not find it.
<a href="PORTAL30.wwsec_app_priv.login?p_requested_url=http://yadda.ya
+dda.yadda..."><font size=-1 class="BannerSecondaryText">Login</a>
I'm tempted to say it's a bug in Mechanize, but I'm not having a good brain day, so maybe I'm just misunderstanding how find_link is supposed to work.
Update: it looks like the reason for this is broken HTML: an unclosed link earlier on the page. |