Hi,
I would like to extract the information of the header from a Web page. I've found an example as the following.
use LWP::Simple qw($ua get);
use HTTP::Headers;
use HTML::HeadParser;
$ua->proxy(http => "$h = HTTP::Headers->new;
$p = HTML::HeadParser->new($h);
$url = '
$content = get($url);
$p->parse($content);
print $h->header('Title')."\n";
print $h->header('Content-Base')."\n";
print $h->header('Last-Modified')."\n";
print $h->header('Content-Length')."\n";
print $h->header('Meta')."\n";
Everything seems fine EXCEPT no info about "last-modified", "content-length" and "meta". I checked on Yahoo Page. In the <head>..</head>, they don't put "last-modified" and "content-length". Does it mean that they have to put those info on the Web so I can get it? Also, there is a meta tag on the page and I'm wondering how can I print out the meta tag.
Thanks,
I would like to extract the information of the header from a Web page. I've found an example as the following.
use LWP::Simple qw($ua get);
use HTTP::Headers;
use HTML::HeadParser;
$ua->proxy(http => "$h = HTTP::Headers->new;
$p = HTML::HeadParser->new($h);
$url = '
$content = get($url);
$p->parse($content);
print $h->header('Title')."\n";
print $h->header('Content-Base')."\n";
print $h->header('Last-Modified')."\n";
print $h->header('Content-Length')."\n";
print $h->header('Meta')."\n";
Everything seems fine EXCEPT no info about "last-modified", "content-length" and "meta". I checked on Yahoo Page. In the <head>..</head>, they don't put "last-modified" and "content-length". Does it mean that they have to put those info on the Web so I can get it? Also, there is a meta tag on the page and I'm wondering how can I print out the meta tag.
Thanks,