Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Problem retrieving Web-page using LWP - help!

by kilinrax (Deacon)
on Nov 30, 2000 at 23:02 UTC ( [id://44189]=note: print w/replies, xml ) Need Help??


in reply to Problem retrieving Web-page using LWP - help!

Try this:
#!/usr/bin/perl -w use strict; use LWP::UserAgent; use URI::URL; my $ua = new LWP::UserAgent; my $page = "http://lsa.colorado.edu/cgi-bin/LSA-sentence-x.html"; my $uri = new URI::URL; $uri->query_form("LSAspace" => "General_Reading_up_to_1st_year_college + (300 factors)", "LSAFactors" => "", "txt1" => "I hate Jimmy. I love Jimmy."); my $req = new HTTP::Request POST => $page; $req->content_type('application/x-www-form-urlencoded'); $req->content($uri->equery); my $res = $ua->request($req); if (!$res->is_success) { die "Fetch failed\n"; } my $content = $res->content; print $content;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://44189]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found