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

Dear monks,

I have to extract content in the web page by post method. If 'http' site it's working. In 'https' site. I am getting error. please see the below code and tell me the changes.

Thanks in advace

use LWP::UserAgent; use HTTP::Request; $username = "xxx"; $password = "xxx"; $url = 'https://adwords.google.com/select/TrafficEstimatorSandbox'; $url_login = 'login.userid='.$username.'&login.password='.$password; my $ua = LWP::UserAgent->new; my $request = HTTP::Request->new(POST => $url); $request->content_type("application/x-www-form-urlencoded"); $request->content($url_login); my $response = $ua->request($request); if ($response->is_success()) { print $response->content; } else { print $response->status_line, " <URL:$url>\n"; }

Replies are listed 'Best First'.
Re: How to extract page content in https site?
by jbrugger (Parson) on Jul 15, 2005 at 07:15 UTC
    you probably miss an ssl enabling package like Crypt::SSLeay

    update: since you're on windows, try PPM> install http://www.activestate.com/PPMPackages/5.6plus/Crypt-SSLeay.ppd

    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
Re: How to extract page content in https site?
by davorg (Chancellor) on Jul 15, 2005 at 08:21 UTC

    As others have pointed out, the error message makes it pretty clear what the problem is and what you need to do to fix it. There's also the file README.SSL which comes with the LWP distribution and explains everything that you need to know.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: How to extract page content in https site?
by gellyfish (Monsignor) on Jul 15, 2005 at 07:54 UTC

    How about you tell us what the actual error you are getting is first, eh?

    /J\

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: How to extract page content in https site?
by tphyahoo (Vicar) on Jul 15, 2005 at 13:40 UTC