$cookie_jar->load($cookie_file); #### #!/usr/bin/perl -w use strict; use Data::Dumper; use WWW::Mechanize; use HTTP::Cookies::Chrome; my $username = '**********'; my $passwd = '*********'; my $cookie_file = 'C:/Users/username/AppData/Local/Google/Chrome/User Data/Default/Cookies'; #chrome cookies path on windows my $cookie_jar = HTTP::Cookies::Chrome->new( # chrome_safe_storage_password => '***", # I don't know what to do here file => $cookie_file, # autosave => 1, # ignore_discard => 0, ); $cookie_jar->load($cookie_file); my $mech = WWW::Mechanize->new( cookie_jar => $cookie_jar, ); #$mech->cookie_jar->scan(sub { print Dumper \@_ }); #print $cookie_jar->as_string; my $uri = URI->new( "https://www.*****.com" ); $mech->get( $uri ); unless ($mech->success) { my $mesg = $mech->response->status_line; print $mesg; goto END; } $mech->set_fields( username => $username, password => $passwd, ); $mech -> submit(); sleep(2); $mech->success() or die "Can't fetch the Requested page"; my @form = ( "formname" ); $mech->form_with_fields( @form ); my $value ='******'; eval {$mech->select('fieldName', $value)}; if ($@ and $@ =~ /Illegal value/) { print "This page has not been loaded..."; goto END; } END :