#!/usr/bin/perl -w use strict; use WWW::Mechanize; use HTTP::Cookies; my $outfile = "out.htm"; my $url = "https://www.mywholesalersite.com/frmLogin.aspx"; my $username = 'user'; my $password = 'passwd'; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($url); $mech->form_name('Form1'); $mech->field(login => $username); $mech->field(passwd => $password); $mech->click(); sleep 3; # We are now logged in. This is verified by viewing the $mech->content $url = 'https://www.mywholesalersite.com/frmReportLineCount.aspx'; $mech->get( $url ); sleep 15; # Allow time for content to be generated $mech->save_content( $outfile ); exit;