in reply to HTML source grab
#!/usr/bin/perl -w use CGI qw(:all); use Fcntl qw(:flock); use HTTP::Request; print header; open(F, "pageinfo.htm"); while(<F>) { print "$_"; } if(!param) { exit; } $fristring = param('urlinfo'); use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->agent("Mozilla/5.0"); $ua->timeout('30'); $req = new HTTP::Request GET => $fristring; $req->header('Accept' => 'text/html'); $result = $ua->request($req); $_ = $result->content; $looper = 0; while($looper < 5000) { s/</</; $looper++; } $looper = 0; while($looper < 500) { s/\n/<BR>/; $looper++; } print $_;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: HTML source grab
by patgas (Friar) on Mar 12, 2002 at 21:45 UTC | |
|
Re: Re: HTML source grab
by jryan (Vicar) on Mar 13, 2002 at 16:05 UTC |