in reply to Re: LWP & Javascript
in thread LWP & Javascript
Here's some more detail. I'm attempting to submit a form and "scrape" the results. Problem being that the webpage uses Javascript form validation and even uses Javascript to do the "submit". I'm really scratching my head here. Here's a snippet of the actual code:$ua->cookie_jar(HTTP::Cookies->new(file => "cookies.yum", autosave => 1));
my $queryStr = "http://track.airborne.com/TrackByNbr.asp?txtTrackNbrs= +$trackNo&hdnTrackMode=nbr&hdnPostType=init&hdnRefPage=0&hdnSent=false +"; my $ua = new LWP::UserAgent; my $agent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"; $ua->agent($agent); $ua->cookie_jar(HTTP::Cookies->new(file => "cookies.yum", autosave => 1)); my $req = new HTTP::Request POST=>$queryStr; $req->content_type('application/x-www-form-urlencoded'); my $res = $ua->request($req); if ($res->is_success) { my $response = $res->content; open (HTMLDUMP, ">$HTMLFile") || die "Could not create $HTMLFile - $!\n"; print HTMLDUMP $response; close (HTMLDUMP); } else { die "Something bad happened...\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: LWP & Javascript
by dws (Chancellor) on Jul 25, 2002 at 06:01 UTC | |
by Anonymous Monk on Jul 25, 2002 at 06:21 UTC | |
by dws (Chancellor) on Jul 25, 2002 at 06:57 UTC | |
by hacker (Priest) on Jul 25, 2002 at 06:58 UTC | |
by belg4mit (Prior) on Jul 28, 2002 at 23:58 UTC |