develooper Front page | perl.libwww | Postings from August 2016

Re: Facing problem with HTML::Parser

Thread Previous
From:
Olaf Alders
Date:
August 12, 2016 19:00
Subject:
Re: Facing problem with HTML::Parser
Message ID:
D93CA689-B86D-4E64-90A0-F7AE1C00EDF5@wundersolutions.com

> On Aug 11, 2016, at 1:44 AM, Shivani Palle <palleshivani@gmail.com> wrote:
> 
> Hi,
> 
> 
> I am facing one issue while using HTML::Parser. Please help me.
> 
> Issue:
> 
> I am using HTML::Parser to parse all the HTML files through out the directories to get hard coded strings from the html files(text between the tags).

This does not directly answer your question, but you can solve the same problem with HTML::Restrict (disclaimer: am author of said module):

use HTML::Restrict;
 
my $hr = HTML::Restrict->new();
 
# use default rules to start with (strip away all HTML)
my $processed = $hr->process('  <b>i am bold</b>  ');
 
# $processed now equals: 'i am bold'

Hope this helps,

Olaf


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About