Re: LWP::HTML

Gisle Aas (aas@a.sn.no)
Wed, 20 Dec 1995 11:58:49 +0100


> Hi.  There must be something obvious in libperl-www 5b5 that I'm  
> missing.  After doing:
> 
>  $h = HTML::Parse::parse_htmlfile($filename);
> 
> How can I get the content of a particular tag, say the TITLE tag?

There is no easy way yet, but this is mentioned in the TODO list as "The 
HTML::Parse module should make meta information (<HEAD>) easier
to access."

Currently you will have to traverse the syntax tree to find the tag you want.  
Call $h->traverse() and stop when you see the <title> element.

> Something like $h->content('title') seems like the right way but
> I guess I'm missing something?

It might become:

  $h->title;
  $h->base
  $h->meta
  $h->nextid
  $h->isindex

--Gisle