Hi, I'm trying to use either LWP::UserAgent or the subclass WWW::Mechanize to create a program that will submit info via forms on the Lexis-Nexis search page, and save the search results. My problem *might* turn out to be one of HTML parsing -- I can't figure out what value to submit to one of the fields. In my browser window, it appears as a pull-down menu with several options to choose from: "Business & Finance", "World News", etc. But the options don't seem to even appear in the source code; instead, the options seem to consist entirely of blank space. I'm stumped -- I don't know what value to have my perl program submit! The relevant source code is below:
<select name="srccat" size="1" onchange="this.options[selectedIndex].s +elected = true;"> <OPTION VALUE="">All Available Documents&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb +sp</option> <OPTION VALUE="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp +;&nbsp</option> <OPTION VALUE="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp +;&nbsp</option> <OPTION VALUE="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp +;&nbsp</option> </select> <A HREF="" onclick="if (!submitForm(docume +nt.forms[0], 'List Sources'))return false;">Source List</A>
Can you tell what the value for the field "srccat" should be? Or can you suggest a way for me to have my program automatically select "Business & Finance" without having to know the value that corresponds to it? If you can help me solve this problem, I'll gladly donate to your site. I'm at my wits' end. Thanks a lot. Best, Julia

In reply to Problem with automating form submission by Anonymous Monk

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.