gube has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

I have posted the question day before. I am getting error in https. Now, i have installed SSL and Crypt-SSLeay. I have given the correct username and password and enter, but, i can extract only initial page. I have to extract page after login. Please modify the code and help me. I am trying for long time.

Thanks in advance.

use LWP; use HTTP::Request::Common; use HTTP::Cookies; my $agent=LWP::UserAgent-> new; $agent-> cookie_jar(HTTP::Cookies->new); $url="https://adwords.google.com/select/TrafficEstimatorSandbox"; $request=POST ($url, Content=> ["login.userid "=>"xxx", "login.passwor +d"=> "xxx"]); $response=$agent-> request($request); print "$response-> code\n"; $response-> is_success or die " $response->message \n"; print $response-> content;

Replies are listed 'Best First'.
Re: Advice me in https Extraction code
by holli (Abbot) on Jul 18, 2005 at 09:11 UTC
    I'd use WWW::Mechanize.
    use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->get( "https://adwords.google.com/select/TrafficEstimatorSandbox +" ); $mech->submit_form ( form_number => 0, fields => { "login.userid" => 'mungo', "login.password" => 'lost-and-alone', } );


    holli, /regexed monk/
Re: Advice me in https Extraction code
by ghenry (Vicar) on Jul 18, 2005 at 08:25 UTC

    As before, what are your errors now?

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!
Re: Advice me in https Extraction code
by gube (Parson) on Jul 18, 2005 at 08:28 UTC

    I am getting no errors. But, i can able to extract only without login page. Even though i have give the username and password and enters it redirect the login page and i am getting extracted only the login page. Please help me