复制代码 代码如下:
include "Snoopy.class.php";
$snoopy = new Snoopy;
$snoopy->proxy_host = "www.7767.cn";
$snoopy->proxy_port = "8080";
$snoopy->agent = "(compatible; MSIE 4.01; MSN 2.5; AOL 4.0; Windows 98)";
$snoopy->referer = "http://www.7767.cn/";
$snoopy->cookies["SessionID"] = 238472834723489l;
$snoopy->cookies["favoriteColor"] = "RED";
$snoopy->rawheaders["Pragma"] = "no-cache";
$snoopy->maxredirs = 2;
$snoopy->offsiteok = false;
$snoopy->expandlinks = false;
$snoopy->user = "joe";
$snoopy->pass = "bloe";
if($snoopy->fetchtext("http://www.7767.cn"))
{
echo "<PRE>".htmlspecialchars($snoopy->results)."</PRE>/n";
}
else
echo "error fetching document: ".$snoopy->error."/n";
array
$e->getAllAttributes ()array
$e->attrstring
$e->getAttribute ( $name )string
$e->attributevoid
$e->setAttribute ( $name, $value )void
$value = $e->attributebool
$e->hasAttribute ( $name )bool
isset($e->attribute )void
$e->removeAttribute ( $name )void
$e->attribute = nullelement
$e->getElementById ( $id )mixed
$e->find ( "#$id", 0 )mixed
$e->getElementsById ( $id [,$index] )mixed
$e->find ( "#$id" [, int $index] )element
$e->getElementByTagName ($name )mixed
$e->find ( $name, 0 )mixed
$e->getElementsByTagName ( $name [, $index] )mixed
$e->find ( $name [, int $index] )element
$e->parentNode ()element
$e->parent ()mixed
$e->childNodes ( [$index] )mixed
$e->children ( [int $index] )element
$e->firstChild ()element
$e->first_child ()element
$e->lastChild ()element
$e->last_child ()element
$e->nextSibling ()element
$e->next_sibling ()element
$e->previousSibling ()element
$e->prev_sibling ()新闻热点
疑难解答