Hello Gisle

HTML::TokeParser can not be used in this situation.  It needs to have
the whole document available at contruction time.  You will have to
use HTML::Parser directly instead.  For this case I would think that
HTML::LinkExtor should also be perfect.  It can give you a callback
each time it finds a link.


Make you callback something like:

my $p;
$req_cb = sub {
my($data, $resp) = @_;
$p ||= HTML::LinkExtor->new(sub { print "Found link\n" }, $resp->base);
$p->parse($data);
}

Yes I know TokeParser needs the whole document, but It would be great If there was any trick to use it with callbacks. The script I sent only it's an example. I can't use HTML::LinkExtor cause I need to extract links and embedded objects, so I will read deeply about HTML processing with trees.

Best Regards,
Andres




_________________________________________________________________
MSN. M�s �til Cada D�a http://www.msn.es/intmap/

Reply via email to