I am trying to get the first paragraph of an article from an html document. I am trying to do this by getting the document from the web, using 'join' to make many lines one line, and then trying to isolate the text I want. Is this workable?
Here's an example of the area of a longer html document that I am trying to parse. (The dateline classes do not appear in all articles. I figure I can get rid of the remaining tags later in the script.) </div> <span class="body-content"><!-- begin body-content --> <p><b><span class="dateline">SARASOTA</span><span class="dateline-separator"> - </span></b>As the search for Carlie Brucia intensified, hundreds of leads helped sketch the portrait of the suspect who authorities say abducted the 11-year-old from a car wash parking lot in February.</p> <p>According to the 615 pages of tips and leads released by the State Attorney's Office on Tuesday Here's my script, which returns 'no match': use LWP::Simple; my @lines = get( "http://www.bradenton.com/mld/bradenton/rss/9837290.htm" ) or die $!; $line = join "", @lines if defined @lines; if ($line =~ /<\!-- begin body-content -->(.*)\/p>/i) { print $1; } else { print 'no match'; } Any advice appreciated. _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
