Hey everyone, I'm trying to submit a form with WWW::Mechanize to post a new thread on a forum from the command line. The forum also requires an image to be uploaded with it. Anyway...here is my snippet:

        $mech->submit_form(
            form_name => 'post',
            fields      => { body => $text, file => $file_location },
            button      => 'post'
        );

When I run the code, I'm getting this error:

Uncaught exception from user code:
There is no form named "post" at /usr/share/perl5/site_perl/WWW/Mechanize.pm line 1938.

But the HTML source code on the site shows that the form name IS indeed "post":

<form name="post" onsubmit="return dopost(this);" enctype="multipart/form-data" action="/post.php" method="post">

Can anyone tell me why I'm receiving this error?

Thanks.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to