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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.