Georgio has asked for the wisdom of the Perl Monks concerning the following question:
, but if in the HTML code there are short links (i.e. not full paths!), they aren't displayed.#!/usr/bin/perl use CGI; use CGI::Carp qw(fatalsToBrowser); use LWP::UserAgent; $cgi = new CGI; # Create a user agent object $ua = new LWP::UserAgent; $ua->agent("AgentName/0.1 " . $ua->agent); # Create a request $req = new HTTP::Request GET => 'http://www.profit-position.com'; $req->content_type('application/x-www-form-urlencoded'); $req->content('match=www&errors=0'); # Pass request to the user agent and get a response back $res = $ua->request($req); # Check the outcome of the response print $cgi->header(); if ($res->is_success) { print $res->content; } else { print "Bad luck this time\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Read and Display HTML - pages with CGI-script.
by simonm (Vicar) on Sep 20, 2003 at 20:11 UTC | |
by Corion (Patriarch) on Sep 20, 2003 at 20:14 UTC | |
|
Re: Read and Display HTML - pages with CGI-script.
by chromatic (Archbishop) on Sep 20, 2003 at 20:04 UTC | |
by simonm (Vicar) on Sep 20, 2003 at 20:27 UTC |