Go Back   Velocity Reviews > Newsgroups > PERL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

PERL - How to use HTML::Parser to remove HTML tags and print result

 
Thread Tools Search this Thread
Old 07-14-2003, 01:07 AM   #1
Default How to use HTML::Parser to remove HTML tags and print result


I am trying to use HTML:arser to parse an HTML file, remove all HTML tags
(including comments, etc.), replace all ENTITIES (e.g. &amp), and put the
result into a variable as a string. I figure HTML:arser itself can
somehow preform the filtering, but how do I get it back as a string? I'd
appreciate some sample code if anyone has any. Sorry if this is a real n00b
question.

Thanks a lot,
Mitchua





Mitchua
  Reply With Quote
Old 07-15-2003, 03:02 PM   #2
Ice Demon
 
Posts: n/a
Default Re: How to use HTML::Parser to remove HTML tags and print result


"Mitchua" <> wrote in message
newsvmQa.23629$ ble.rogers.com...
> I am trying to use HTML:arser to parse an HTML file, remove all HTML

tags
> (including comments, etc.), replace all ENTITIES (e.g. &amp), and put the
> result into a variable as a string. I figure HTML:arser itself can
> somehow preform the filtering, but how do I get it back as a string? I'd
> appreciate some sample code if anyone has any. Sorry if this is a real

n00b
> question.
>
> Thanks a lot,
> Mitchua


Try this for a sample of parsing a webpage
http://www.wdvl.com/Authoring/Langua...ummarizer.html
If you are just trying to remove all the html tags, you could just do this
$webpage =~ s/<.*?>//g;

Ice Demon
http://adult-xxx-newsgroups.com
http://adult-cybergames.com
http://adult-spider.com


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump