in reply to LWP, SSL, cookie session?
You are printing out your request as a string.
Probably what you want is the result, ie the returned page.
The variable you're looking for in that case is:
Here's a modified version of your code, but be warned that i can't test it here at work (no perl, and i can't install it).$res->content;
Or, if you really prefer to abstract, you could say:#!/usr/lib/perl -w use strict; use LWP::UserAgent; use Crypt::SSLeay; use HTTP::Request::Common; use HTTP::Cookies; use LWP::Simple; use LWP::Debug qw(+); my $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "cookie_jar", autosave => 1 +)); $ua->timeout(300); my $req = POST 'https://adwords.google.com/select/main', ['login.userid' => 'test@test.com', 'login.password' => 'testabc', 'cmd' => 'LoginValidation', 'login' => 'Login' ]; my $res = $ua->request($req); unless ($res->is_success) { print "Login Failed: : ". $res->status_line . "\n"; return 0; } # These lines are unnecessary # my $b = $req->as_string; # my $req = ''; print "\n\n\nThe 1st result is:\n$res->content\n";
my $b = $res->content;
|
|---|