$string = LPW->get (or whatever)...
if($string =~ s/<table>(.+)<\/table>/ig){
$table_contents = $1;
}
that's it. If you need the <table> tags too, just put the brackets a
little wider.
On Wed, 10 Jul 2002, Steven Kreuzer wrote:
> I have an HTML file that I grab with LWP::Simple, however, What I really
> need is just the HTML between <TABLE> and </TABLE>, everything else
> discarded.
> I did some searches on google but was unable to come up with anything, I
> know this is rather trivial for the experts, but if anyone can lend me
> some assistance, I would be grateful
>
> The HTML Code for the Table Looks like This:
>
> <table WIDTH="540" CELLPADDING="2" CELLSPACING="0" BORDER="1">
> <tr><td WIDTH="15%" VALIGN=TOP><p><b>ZIP</b></td>
> <td WIDTH="50%" VALIGN=TOP><p><b>CITY AND STATE</b></td>
> <td WIDTH="25%" VALIGN=TOP><p><b>COUNTY</b></td>
> <td WIDTH="10%" VALIGN=TOP><p><b>AREA</b></td></tr>
> <tr><td WIDTH="15%" VALIGN=TOP><p>10036</td>
> <td WIDTH="50%" VALIGN=TOP><p>New York, NY</td>
> <td WIDTH="25%" VALIGN=TOP><p>New York</td>
> <td WIDTH="10%" VALIGN=TOP><p>212</td></tr>
> </table>
>
> SK
>
>