diamich has asked for the wisdom of the Perl Monks concerning the following question:
What do I add to it before printing $webpage to remove the <html>, </html>, <body>, </body>, <head>, and </head> tags (as well as everything that falls between <head> </head>)? I'm also guessing that I would no longer need: print "Content-type: text/html\n\n"; Correct? Thanks in advance for any help you guys could give me.$uatopasson = $ENV{"HTTP_USER_AGENT"}; $referertopasson = $ENV{"HTTP_REFERER"}; $ua = LWP::UserAgent->new; $ua->agent($uatopasson); $req = HTTP::Request->new (GET => "$file"); $req->header('referer' => $referertopasson); $res = $ua->request($req); $webpage = $res->content; print "Content-type: text/html\n\n"; print $webpage;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Removing selective tags and content between
by Ovid (Cardinal) on Oct 15, 2003 at 14:15 UTC | |
by diamich (Initiate) on Oct 15, 2003 at 14:33 UTC | |
by Ovid (Cardinal) on Oct 15, 2003 at 16:07 UTC | |
|
Re: Removing selective tags and content between
by ChrisR (Hermit) on Oct 15, 2003 at 14:56 UTC | |
by diamich (Initiate) on Oct 15, 2003 at 15:17 UTC | |
by ChrisR (Hermit) on Oct 15, 2003 at 15:29 UTC | |
by diamich (Initiate) on Oct 15, 2003 at 16:10 UTC | |
by diamich (Initiate) on Oct 15, 2003 at 18:06 UTC |