Ask a Question related to Perl / CGI, Design and Development.
-
franck #1
HTML::Parser
Greetings,
How should i use HTML::Parser to extract text bettween font tags with
attibuts like this:
<font face="Arial" size="2"> the text to extract </font>
Thanks
Franck
franck Guest
-
Possible bug in HTML::Parser
Hello. I am using the HTML::Parser module to parse a list of bookmarks exported from the Firefox browser. Firefox exports bookmarks to an HTML... -
HTML Parser
Try something like this. This does send any form information, but only gets the html markup of the page. If you want to send form or query data that... -
HTML-Parser-3.35
"Brad Olin" <bwo@bwo1.com> wrote in message news:qvmg001be5ge2qs9o23561il50urj0lcb5@4ax.com... Very puzzling. Are you sure you don't have LWP... -
HTML-Parser / SGML-Parser
Ok, silly question. I am writing a script to determine my router's WAN ip address and then to email me once an hour in case it changes. Currently... -
How to use HTML::Parser to remove HTML tags and print result
I am trying to use HTML::Parser to parse an HTML file, remove all HTML tags (including comments, etc.), replace all ENTITIES (e.g. &), and put... -
Gisle Aas #2
Re: HTML::Parser
Tim Heaney <theaney@cablespeed.com> writes:
[...]> "franck" <f.collineau@voila.fr> writes:>> >
> > How should i use HTML::Parser to extract text bettween font tags with
> > attibuts like this:
> > <font face="Arial" size="2"> the text to extract </font>
> How about something like this?
This kind of filtering can also be done by setting up the> my %want = (tag => 'font',
> attrs => { face => "Arial", size => "2" });
>
> sub start_handler {
> my($tag, $attr) = @_;
> return unless $tag eq $want{tag};
'report_tags' attribute of the parser itself. That way of doing it is
much more efficient as it reduce the number of callbacks invoked
dramatically.
$parser->report_tags($want{tag});
--
Gisle Aas
Gisle Aas Guest
-
Tim Heaney #3
Re: HTML::Parser
Gisle Aas <gisle@ashn89ty262h.bc.hsia.telus.net> writes:
Ah, yes. Thanks! In addition to the efficiency argument, I think it>
> This kind of filtering can also be done by setting up the
> 'report_tags' attribute of the parser itself. That way of doing it is
> much more efficient as it reduce the number of callbacks invoked
> dramatically.
>
> $parser->report_tags($want{tag});
improves the readablility of both start_h and end_h too.
Thanks again,
Tim
Tim Heaney Guest



Reply With Quote

