Home >Backend Development >PHP Tutorial >lazysnoopy snoopy PHP version of the network client provides local download

lazysnoopy snoopy PHP version of the network client provides local download

WBOY
WBOYOriginal
2016-07-29 08:37:561409browse

Snoopy is used in magpierss, which makes me a little interested in studying this dongdong. I found this source code on SF. It’s actually just a class, but don’t laugh at it, the function is very powerful.我 The official profile, I translated (Khan ... I have always acted as a translator recently)
Snoopy is a PHP class that is used to imitate the function of the web browser.
The following are some of its features:
1. Convenient to crawl the content of the webpage
2. Convenient to crawl the text of the webpage (remove HTML code)
3. Convenient to crawl the links of the webpage
4. Support proxy host
5. Support Basic user/password authentication mode
6. Support custom user agent, referer, cookies and header content
7. Support browser redirection and control the redirection depth
8. Can expand links in web pages into high-quality URLs (Default)
9. Convenient to submit data and get return value
10. Support tracking HTML framework (added in v0.92)
11. Support passing cookies when redirecting
The following is a simple example, for example, let's grab my Blog text
include "Snoopy.class.php";
$snoopy = new Snoopy;
$snoopy->fetchtext("http://www.phpobject.net/blog");
echo $ snoopy->results;
?>
^_^, good, for example, grabbing links
include "Snoopy.class.php";
$snoopy = new Snoopy;
$snoopy-> fetchlinks("http://www.phpobject.net/blog");
print_r($snoopy->results);
?>
Hey, the effect is good, and all are the URLs we need, but not Something like /blog/read.php/85.htm.
Also submit data for testing later. . .
yuanma/php/Snoopy-1.2.3.tar.gz local download
The above has introduced lazysnoopy snoopy. The PHP version of the network client is available for local download, including lazysnoopy content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn