|
Prev: access denied
Next: xml::twig - writing utf-8
From: Nospam on 11 May 2006 21:54 I am trying to see how mechanize reads the fields on this page: http://www.disboards.com/newreply.php?do=newreply&noquote=1&p=12615079 looking at the source code for example for username I see: <td class="smallfont" colspan="2"><input type="text" class="bginput" name="username" value="Unregistered" size="50" style="margin-top:1px" /></td> I am assuming mechanize is expecting $mech->field('username','name'); for the username field and for the title looking at the source code: td><input type="text" class="bginput" name="title" value="" size="50" maxlength="85" tabindex="1" title="Optional" /></td> <td> </td> <td><img id="display_posticon" src="clear.gif" alt="" /></td> $mech->field('title','title'); for the title field and from the source code: <div class="controlbar" style="text-align:left"> <textarea name="message" rows="20" cols="60" wrap="virtual" style="width:540px; height:250px" tabindex="1"></textarea> </div> I assume $mech->field('message','message'); for the message field, however all I see is no such field 'username' so far my prog is: #! perl\bin\perl use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $START = 'http://www.disboards.com/newreply.php?do=newreply&noquote=1&p=12615079'; $mech->get( $START ); $mech->form(2); $mech->field('username','username'); $mech->field('title','title'); $mech->field('message','Message'); $mech->click("sbutton");
|
Pages: 1 Prev: access denied Next: xml::twig - writing utf-8 |