![]() |
|
||||||||||
|
|||||
|
подскажите как через сокет достать страничку ?
и какие есть варианты кроме использования сокета ? спасибо. |
|
|||||
|
use IO::Socket;
$host = "any.host.com"; $file = "/any/file.html"; $query = "GET $file HTTP/1.0\n". "Host: $host\n". "\n"; $remote = IO::Socket::INET->new(Proto=>"tcp",PeerAddr=>$host,PeerPort=>"http(80)"); unless ($remote) {exit;} $remote->autoflush(1); print $remote $query; $answer = join("",<$remote>); close $remote; $answer - то, что хотел достать.
__________________
Two beer or not two beer?... |
![]() |
Часовой пояс GMT +4, время: 03:53. |
|
|
« Предыдущая тема | Следующая тема » |
|
|