Hi
I need to download html site source via perl script.
What I've up to now is such a code
print "Content-type: text/html\n\n";
use IO::Socket;
$sock = IO::Socket::INET->new(PeerAddr => '217.xxx.yyy.zzz',
PeerPort => 'http(80)',
Proto => 'tcp');
die "$!" unless $sock;
$sock->autoflush();
print $sock "GET / HTTP/1.0" . "\015\012" x2;
$document = join('', <$sock>);
print "$document\n";
However it downloads only the major html site - let's say on server 217.xxx.yyy.zzz i have file01.html file02.html.
My question is how to download file02.html content ?
If I put $sock = IO::Socket::INET->new(PeerAddr => '217.xxx.yyy.zzz/file02.html',
PeerPort => 'http(80)',
Proto => 'tcp');
it does not work and that's nothing suprising about that as I must specify host, right ? But how can I specify particular file ?
Thanks for any suggestions
I need to download html site source via perl script.
What I've up to now is such a code
print "Content-type: text/html\n\n";
use IO::Socket;
$sock = IO::Socket::INET->new(PeerAddr => '217.xxx.yyy.zzz',
PeerPort => 'http(80)',
Proto => 'tcp');
die "$!" unless $sock;
$sock->autoflush();
print $sock "GET / HTTP/1.0" . "\015\012" x2;
$document = join('', <$sock>);
print "$document\n";
However it downloads only the major html site - let's say on server 217.xxx.yyy.zzz i have file01.html file02.html.
My question is how to download file02.html content ?
If I put $sock = IO::Socket::INET->new(PeerAddr => '217.xxx.yyy.zzz/file02.html',
PeerPort => 'http(80)',
Proto => 'tcp');
it does not work and that's nothing suprising about that as I must specify host, right ? But how can I specify particular file ?
Thanks for any suggestions