Home > Article > Backend Development > Snoopy PHP version of the network client provides local download_PHP tutorial
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