Skip to content

Instantly share code, notes, and snippets.

@AlexTape
Last active August 29, 2015 14:27
Show Gist options
  • Save AlexTape/f30a8c7cd6c19c63c25b to your computer and use it in GitHub Desktop.
Save AlexTape/f30a8c7cd6c19c63c25b to your computer and use it in GitHub Desktop.
Perl Mechanize Webpage
use strict;<br>
use WWW::Mechanize;<br>
my $username = "USER"; # Login<br>
my $password = "PASSWORD"; # Password<br>
my $url = "http://www.myurl.com"; # Your URL Name<br>
my $mech = WWW::Mechanize->new();<br>
$mech->get($url);<br>
## Browse the HTML source of the ASP page to get these parameters <br>
$mech->form("form_Name"); # The Login Form Name<br>
$mech->field("txt_id", $username); # Username Texbox name<br>
$mech->field("txt_pwd", $password); # Password Textbox name<br>
$mech->click("cmd_ok"); # Button name<br>
my $current_site = $mech->{uri};
#The $current_site would give you the address of next page...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment