My question is akin to that posed at http://www.webmasterkb.com/Uwe/Forum.aspx/perl/29478/WWW-Scripter-or-Javascript-and-perl I am trying to control a dropdown menu through perl:
<label for="search_rpp">Results per page:</label> <select id="search_rpp"> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> <option value="40" selected>40</option> </select>
I know it is controlled by Javascript but I can't seem to make any headway. I also can't seem to download wsp.pl from http://www2.research.att.com/sw/tools/wsp/ because it is asking me for a username and password. Here is the code I have so far.
#!/usr/bin/perl use strict; use WWW::Scripter; my $m = WWW::Scripter->new(); $m->use_plugin('JavaScript'); $m->agent_alias('Windows IE 6'); my $zip1 = '91502'; my $keyword = 'restaurants'; my $url = 'http://www.yelp.com'; $m->get($url); $m->forms; $m->form_number(1); $m->field('find_desc',$keyword); $m->field('find_loc', $zip1); $m->submit(); $m->select('search_rpp', '40'); $m->click();
This produces the following error "Input "search_rpp" not found". I assume this is because the select method requires the argument to be the name, which is missing. P.S. This is my first post so please excuse any failure to conform to the monastery's conventions.

In reply to WWW::Scripter Help by pechorin

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.