[26770] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8840 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 9 00:05:39 2006

Date: Sun, 8 Jan 2006 21:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 8 Jan 2006     Volume: 10 Number: 8840

Today's topics:
    Re: form fields <tadmc@augustmail.com>
    Re: form fields <nospam@home.com>
    Re: form fields <no@email.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 8 Jan 2006 08:18:39 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: form fields
Message-Id: <slrnds27pv.tsf.tadmc@magna.augustmail.com>

Nospam <nospam@home.com> wrote:

> I am wondering what fields I would have to use with www::mechanize for it to
> recognise
> 
> $mech->field('username' => "$username1")->url();


   perldoc -q vars


>     $mech->field('subject' => "$subject")->url();
>     $mech->field('message' => "$message")->url();
> 
> don't seem to work, I get the error msg:
> 
> Can't call method "value" on an undefined value at
> C:/Perl/lib/WWW/Mechanize.pm
> line 1052.


Please post a short and complete program that we can run that
gives you that error message, and we will help solve your problem.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Sun, 08 Jan 2006 17:28:01 GMT
From: "Nospam" <nospam@home.com>
Subject: Re: form fields
Message-Id: <BYbwf.25390$r4.19544@newsfe1-gui.ntli.net>

As requested

#!perl\bin\perl
use strict;
use warnings;
use WWW::Mechanize;


my $mech = WWW::Mechanize->new();







my $url ='http://www.warservers.com/f/posting~mode~newtopic~f~3.htm';


    $mech->get( $url );



    $mech->submit_form(
        form_name => 'post',

        fields    => { username  => 'guesth', },

fields    => { subject  => 'testing', },

        fields    => { message  => 'Testing...', },






        $mech->click()



    );


"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnds27pv.tsf.tadmc@magna.augustmail.com...
> Nospam <nospam@home.com> wrote:
>
> > I am wondering what fields I would have to use with www::mechanize for
it to
> > recognise
> >
> > $mech->field('username' => "$username1")->url();
>
>
>    perldoc -q vars
>
>
> >     $mech->field('subject' => "$subject")->url();
> >     $mech->field('message' => "$message")->url();
> >
> > don't seem to work, I get the error msg:
> >
> > Can't call method "value" on an undefined value at
> > C:/Perl/lib/WWW/Mechanize.pm
> > line 1052.
>
>
> Please post a short and complete program that we can run that
> gives you that error message, and we will help solve your problem.
>
>
> -- 
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas




------------------------------

Date: Sun, 08 Jan 2006 18:35:08 +0000
From: Brian Wakem <no@email.com>
Subject: Re: form fields
Message-Id: <42d4asF1i7t81U1@individual.net>

Nospam wrote:

> As requested
> 
> #!perl\bin\perl
> use strict;
> use warnings;
> use WWW::Mechanize;
> 
> 
> my $mech = WWW::Mechanize->new();
> 
> 
> 
> 
> 
> 
> 
> my $url ='http://www.warservers.com/f/posting~mode~newtopic~f~3.htm';
> 
> 
>     $mech->get( $url );
> 
> 
> 
>     $mech->submit_form(
>         form_name => 'post',
> 
>         fields    => { username  => 'guesth', },
> 
> fields    => { subject  => 'testing', },
> 
>         fields    => { message  => 'Testing...', },
> 
> 
> 
> 
> 
> 
>         $mech->click()
> 
> 
> 
>     );
> 


What's with all the white space and top posting?

Odd number of elements in hash assignment
at /usr/lib/perl5/site_perl/5.8.6/WWW/Mechanize.pm line 1452.
Unknown submit_form parameter "HTTP::Response=HASH(0x84a0c64)" at
scripts/tmp/tmp70.pl line 22

The $mech->click() should not be there.


Try something like this:

#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;

my $url ='http://www.warservers.com/f/posting~mode~newtopic~f~3.htm';
my $mech = WWW::Mechanize->new();

$mech->get( $url );
$mech->form(1);
$mech->field('username','guesth');
$mech->field('subject','testing');
$mech->field('message','Testing...');
$mech->click();




-- 
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8840
***************************************


home help back first fref pref prev next nref lref last post