Snoopy is a PHP class that mimics the functionality of a Web browser, which completes 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 (get rid of 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 browser steering, and can control the steering depth
8, can extend the link in the webpage to the High quality URL (the default)
9. Easy to submit data and get return value
10, support the tracking HTML frame (v0.92 added)
11. Transfer cookies when supporting and turning again
For specific use, see the instructions in the download file.
Copy Code code as follows:
<?php
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's name
$submit _vars["password"] = "*******"; Your code.
$submit _vars["QuestionID"] = "0";
$submit _vars["answer"] = "";
$submit _vars["loginsubmit"] = "submit";
$snoopy->submit ($submit _url, $submit _vars);
Print $snoopy->results;
?>