Mar 7, 2009, 1:28 AM
Post #1 of 2
Ok, so I understand how I can use TokeParser to extract tags and values from the tags for say links or images. But what about extracting data from a tag like a blockquote, or all bold text? How do I extract multiple instances of text contained within an opening and closing tag? i have used the following code to extract a single blockquote, but I need to repeat this for every blockquote within the HTML source.
Extracting blockquotes and text within them?
my $html = lc($source);
my $start = index($html, '<blockquote');
my $end = index($html, '</blockquote>') + 13;
my $blockquotes = substr($content, $start, $end - $start);
I'd like to strip it down so that all text is extracted from each blockquote tag, and placed on a single line in an array. Any help is appreciated.
(This post was edited by albinodog on Mar 7, 2009, 1:29 AM)