Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the introduction and characteristics of PHP Snoopy

2025-02-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "what are the introduction and characteristics of PHP Snoopy". In daily operation, I believe many people have doubts about the introduction and characteristics of PHP Snoopy. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "the introduction and characteristics of PHP Snoopy". Next, please follow the editor to study!

What is the PHP class Snoopy?

Snoopy is a php class that mimics the functions of web browsers. It can complete the task of getting web content and sending forms.

Some features of the PHP class Snoopy:

* easy to crawl the content of the web page

* easy to crawl the text content of a web page (remove HTML tags)

* easy to crawl links to web pages

* proxy hosts are supported

* basic username / password authentication is supported

* support setting user_agent, referer (source), cookies and header content (header file)

* support browser steering and control steering depth

* ability to expand links in web pages to high-quality url (default)

* it is convenient to submit data and obtain return values

* support tracking HTML framework (v0.92 added)

* support passing cookies when redirecting (v0.92 added)

The correct operation of the PHP class Snoopy requires that your server's PHP version is above 4 and supports PCRE (Perl Compatible Regular Expressions) and basic LAMP services.

It provides the following interfaces or methods:

Fetch ($URI)

This method is to grab the content of the page. $URI is the URL of the page to be crawled. The crawled results are stored in $this- > results. If you crawl a frame, each frame will be crawled and the result will be saved to an array.

Fetchtext ($URI)

This method is roughly the same as fetch (), except that the result is text, excluding HTML tags and other extraneous information.

Fetchform ($URI)

This method only returns the form element on the crawled web page.

Fetchlinks ($URI)

This method only returns the links on the crawled web page, and the links returned by default are links with domain names.

Submit ($URI,$formvars)

This method submits a form to the specified $URI. Formvars is the array of form variables to be passed.

Submittext ($URI,$formvars)

This method is basically the same as submit (), but it returns text, excluding html tags and other extraneous data.

Submitlinks ($URI)

This method returns a link.

At this point, the study of "what are the introduction and characteristics of PHP Snoopy" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report