Red Chubby Snoopy Snoopy class use small example

Source: Internet
Author: User
Tags php class
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.