Snoopy is a powerful analog browser method of PHP classes, often used to collect web page content, is a very powerful category, can Use this kind of simulation browser to complete the task of obtaining web page content and sending form. The following is a detailed introduction to the characteristics of Snoopy.class.php and some common usage.
function feature
Snoopy is a PHP class, which is used to imitate the function of web browser, and it can complete the task of obtaining web page content and sending form. Some functional features of Snoopy:
content fetch ()
to grab web page text content (remove HTML label) fetchtext ()
grab web page, form fetchlinks () fetchform ()
support proxy host
support basic username / password authentication / > support / > support Set user_agent, referer (incoming), cookies and header content (header file)
support browser redirection, and control redirection depth
can extend the link in a web page to high quality URL (default)
submit data and get return value
support tracking HTML framework
support weight. It is OK to pass Cookies
at PHP4 when you are orienting. Since it is a class of PHP without expansion support, the server does not support the best choice for curl.
use the method
1, download the Snoopy class
download address: http://sourceforge.net/projects/snoopy/
2, instantiate object
and then call the corresponding method to get the crawled page information
[code]
$results = $snoopy-.gt; results; [/code]