I am trying to automate web navigation and need to fill a form that has a html text input with a default value

http://genome.ucsc.edu/cgi-bin/hgTables?command=start

this is website

<input type="TEXT" name="position" size="26" value="chr21:33031597-33041570" onfocus="setRadioCheck('hgta_regionType', 'range'); regionType='range'">

but i am unable to change the default value to the text input using set_fields()method.

My code

use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->agent('Mozilla/5.0'); $mech->proxy(['https', 'http', 'ftp'], 'http://202.41.70.84:6588'); open(DIR,"C:\\Users\\DELL\\Desktop\\Output\\outofBlat.txt") or die "Co +uldnt open"; open (FH1,">>C:\\Users\\DELL\\Desktop\\outoftables.html"); my@x=<DIR>; $num=1; $input="chr21:36259390-36260987"; $url="http://genome.ucsc.edu/cgi-bin/hgTables?hgsid=304457625"; $mech->get($url); die $mech ->res->status_line unless $mech ->success ; #+ML::Form $form = $mech->form_name("mainForm"); foreach my $inputfield (@inputfields) { if ($inputfield=~/posi +tion/) { $mech->set_fields($inp +utfield=>$input); } } $mech->submit; die $mech ->res->status_line unless $mech ->success ; # If the form sends you somewhere, you can catch it : my $new_url = $mech ->response->request->uri->as_string ; $html= $mech->content; print $html; print FH1 $html;

help me plz ...URGENT


In reply to WWW::Mechanize navigation by abhipataskar42

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.