Snoopy class using small examples _php tips

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

?>

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.