I'm trying to use LWP to get a https page, but the request always
returns with is_success = 0.  According to straces output, it doesn't
even attempt to do any network connection. Here is the script that I
am using:

====================================================================
#!/usr/bin/perl

use English;
use LWP::UserAgent;


sub getTradingPage {
  my ($ticker) = @_;

  $ua = new LWP::UserAgent;
  $ua->agent("Mozilla" . $ua->agent);
  
  
  $req = new HTTP::Request GET => 
"https://trading.etrade.com/cgi-bin/gx.cgi/applogic+TradeMain";
#  $req->header(Cookie => $cookie);
  $res = $ua->request($req);
  if (! $res->is_success) {
    die "Bad luck this time: ".$res->is_success." ($ERRNO)\n";
  }

  print "res=".$res->content()."\n";

  return $res->content();
}


$string = getTradingPage();

print "page=$string\n";
====================================================================

What am I doing wrong?

Alain

Reply via email to