On Mon, Jul 28, 2003 at 04:32:12PM -0500, Andy Lester wrote:
> At 2:15 PM -0700 7/28/03, Bill Moseley wrote:
> >If not, anyone have an example of how to correctly parse the tag?
> >
> 
> I hope there isn't.  LWP::UserAgent doesn't understand HTML. 

Well it does do some parsing of the <head> section into the response 
object.  $ua->parse_head().  But I'm not clear what all is parsed.  
I know title is.

[EMAIL PROTECTED]:~/apache$ perl lwp.pl
Title is: The title

[EMAIL PROTECTED]:~/apache$ cat lwp.pl
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$response = $ua->get('http://localhost/apache/test.html');

print "Title is: ", $response->header('title'),"\n";
[EMAIL PROTECTED]:~/apache$ cat test.html
<html>
<head><title>The title</title></head>
<body>
</body>
</html>


[EMAIL PROTECTED]:~/apache$ perl lwp.pl
Title is: The title



-- 
Bill Moseley
[EMAIL PROTECTED]

Reply via email to