I have a webpage that requires a login upon loading. After entering your credentials, you are taken to a page where there is a search box I want to fill out, as the search box is filled out, there are suggestions that start showing up, you'll have to pick from the dropdown list (it's an input box, I'm guessing javascript is populating a list you can choose from). I want the result of the search box.

In short:

  1. Log in
  2. Enter data into search box
  3. Pick from suggested results
  4. Store results in variable

Right now I just use the WWW::Mechanize module and have the login part done. I do not know how to access the next page where I can enter data into a search field. I was thinking I could do something with $results.

Please advise.
my $mech = WWW::Mechanize->new(); $mech->get('http://loginpage/Account/LogOn'); my $result = $mech->submit_form( form_number => '1', fields => { 'UserName' => '$username', 'Password' => "$pw", }, );

In reply to Navigating multiple layers webpage by ttran18

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.