Skip to content

Instantly share code, notes, and snippets.

@JEEN
Created October 13, 2009 05:11
Show Gist options
  • Save JEEN/209007 to your computer and use it in GitHub Desktop.
Save JEEN/209007 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Config::Pit;
use WWW::Mechanize;
my $config = pit_get('www.naver.com', require => {
url => "your url on example",
username => "your username on example",
password => "your password on example",
});
my $mech = WWW::Mechanize->new;
$mech->get($config->{url});
$mech->follow_link(n => 3);
$mech->follow_link( text_regex => qr/download this/i );
$mech->follow_link( 'http//www.host.com/index.html' );
$mech->submit_form(
form_number => 3,
fields => {
username => $config->{username},
password => $config->{password},
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment