bakiperl has asked for the wisdom of the Perl Monks concerning the following question:
returns this warning: "Decrypted cookies is not set up at..."$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 t +o 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 :
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Loading browser cookies into WWW::Mechanize
by Aldebaran (Curate) on Jul 17, 2021 at 01:51 UTC | |
by bakiperl (Beadle) on Jul 17, 2021 at 04:01 UTC | |
|
Re: Loading browser cookies into WWW::Mechanize
by Anonymous Monk on Jul 17, 2021 at 05:39 UTC | |
by bakiperl (Beadle) on Jul 17, 2021 at 09:12 UTC | |
by marto (Cardinal) on Jul 17, 2021 at 09:53 UTC |