in reply to Extract Web page contents

To get the data between BODY, is more easy to do in this way:
my ($html_body) = ( $html_data =~ /<body.*?>(.*?)<\/body>/gsi );
But the use of HTML::TokeParser::Simple can be very helpful for more complex things! ;-P

Graciliano M. P.
"The creativity is the expression of the liberty".

Replies are listed 'Best First'.
Re^2: Extract Web page contents
by Aristotle (Chancellor) on Dec 27, 2002 at 22:09 UTC
    <body onLoad="alert('>> it's broken! <<')">

    Makeshifts last the longest.

      I used to work with a guy who deliberately put stuff like that in hit HTML to mess with people who didn't do HTML parsing correctly :)

      Cheers,
      Ovid

      New address of my CGI Course.
      Silence is Evil (feel free to copy and distribute widely - note copyright text)

Re: Re: Extract Web page contents
by vek (Prior) on Dec 27, 2002 at 13:21 UTC
    Parsing *ML with a regex eh? Shame on you :-)

    -- vek --
Re: Re: Extract Web page contents
by gmpassos (Priest) on Dec 27, 2002 at 13:47 UTC
    ehehehe! I don't have shame to be economic! ;-P

    I just think that to just get the body we don't need a fat parser!

    But for complex things the parser is a bless, and the prevoius node show in a simple way how to use it!

    Graciliano M. P.
    "The creativity is the expression of the liberty".