in reply to Re: Re:* Mechanizing Javascript form
in thread Mechanizing Javascript form

More directly Perl-related is the issue I'm wrestling with right now. I'm trying to get to the page with the form, by finding the Login link on a startup page.

Here's the pertinent code. On an earlier pass, I had the commented section uncommented, so that I got a local copy of the file.

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.