Home >Backend Development >PHP Tutorial >Snoopy PHP version of the network client provides local download_PHP tutorial

Snoopy PHP version of the network client provides local download_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:52:38818browse

snoopy is used in magpierss, which makes me a little interested in studying this dong dong. I found this source code on SF. It’s actually just a class, but don’t laugh at it, the function is very powerful.

I translated the official introduction (haha...I always act as a translator recently)
snoopy is a php class that is used to imitate the functions of a web browser. It can complete the acquisition of web pages content and the task of sending the form.
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. Conveniently submit data and obtain return values
10. Support tracking HTML framework (added in v0.92)
11. Support passing cookies when redirecting



The following is a simple example, for example, we capture the text of my blog

include "Snoopy.class.php";
$snoopy = new Snoopy;
$snoopy->fetchtext("http://www.phpobject.net/blog");
echo $snoopy- >results;
?>

^_^, good, for example, grab the link

$snoopy = new Snoopy;
$snoopy->fetchlinks("http://www.phpobject.net/blog");
print_r($snoopy->results);
? >

Hey, the effect is good, and all of them are the URLs we need, and there is no such thing as /blog/read.php/85.htm.

Also submit data for testing later. . .
yuanma/php/Snoopy-1.2.3.tar.gz local download

http://www.bkjia.com/PHPjc/318868.html

truehttp: //www.bkjia.com/PHPjc/318868.htmlTechArticlemagpierss uses snoopy, which makes me a little interested to study this dong dong. I found this source code on SF. It’s just a class, but don’t laugh at it, the function is very powerful...
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