vBulletin login with WWW::Mechanize

| No Comments | Bookmark and Share

This is just part of a script that I wrote to...do something. The pertinent part here is using WWW::Mechanize to login to a vBulletin web forum. I figure Googlebot will guide someone trying to figure out how to use WWW::Mechanize this way.

use WWW::Mechanize;
my $username = "foo";
my $password = "bar";
my $forum = "http://www.foo.com/forum/";

my $mech = WWW::Mechanize->new  (
                                    autocheck   =>  1,
                                    agent       =>  'Perl WWW::Mechanize',
                                );

$mech->get( $forum );
$mech->submit_form(
                        form_number =>  1,
                        fields      =>  {
                                            vb_login_username => $username,
                                            vb_login_password => $password
                                        }
                    );
$mech->follow_link(
    text => "Click here if your browser does not automatically redirect you."
    );

Leave a comment

About this Entry

This page contains a single entry by Drew Stephens published on April 3, 2006 12:45 PM.

Marvell Gigabit ethernet adapter was the previous entry in this blog.

What happened here? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 5.1