Snoopy is a PHP class that mimics the functionality of a Web browser, which accomplishes the task of getting web content and sending forms.
Here are some of its features:
1, easy to crawl the content of the Web page
2, easy to crawl the text of the page (remove the HTML code)
3, easy to crawl web links
4, support Agent Host
5, support the basic user/password Authentication mode
6. Support custom user Agent,referer,cookies and header content
7. Support the browser steering, and can control the steering depth
8, can expand the link in the Web page into a high-quality URL (default)
9, convenient to submit data and get the return value
10. Support for tracking HTML frame (v0.92 added)
11. Pass cookies when supporting the re-turn
For specific use, see the instructions in the download file.
Copy the Code code as follows:
Include "Snoopy.class.php";
$snoopy = new Snoopy;
$snoopy->fetchform ("Http://www.phpx.com/happy/logging.php?action=login");
Print $snoopy->results;
< PHP
Include "Snoopy.class.php";
$snoopy = new Snoopy;
$submit _url = "Http://www.phpx.com/happy/logging.php?action=login";
$submit _vars["LoginMode"] = "normal";
$submit _vars["Styleid"] = "1";
$submit _vars["cookietime"] = "315360000";
$submit _vars["Loginfield"] = "username";
$submit _vars["username"] = "********"; Your user name
$submit _vars["password"] = "*******"; Your password.
$submit _vars["QuestionID"] = "0";
$submit _vars["answer"] = "";
$submit _vars["loginsubmit"] = "submit";
$snoopy->submit ($submit _url, $submit _vars);
Print $snoopy->results;
?>
The above describes the red Chubby Snoopy Snoopy class use small examples, including the red chubby Snoopy aspects of the content, I hope that the PHP tutorial interested in a friend helpful.