in reply to Strip text from HTML
Nice one, here's how to do it using the HTML::Parser v.3 interface
#!/usr/bin/perl -w use strict; use HTML::Parser 3; my $parser = HTML::Parser->new( text_h => [ sub { print shift }, 'dtext' ] )->parse_file(*DATA); __DATA__ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-12 +52"> <title>Index</title> </head> <body> <h1>Hello World</h1> <p>Just Another <p>Parser Hack </body> </html>
Cheers,
briac
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Strip text from HTML
by tachyon (Chancellor) on Oct 02, 2001 at 05:52 UTC |