开发者

PHP Crawling Methods

Any one can tell me if curl is not able to crawl in PHP then which metho开发者_如何学运维d will be used for crawling?


If you are referring to creating a spider to crawl entire remote sites the way utilities like wget can, I don't believe cURL has that capability. cURL would be used to make the requests and download each page, but you have to create the logic in your PHP script to parse the content of the pages, extract the links, and create a list of URLs to crawl. cURL doesn't do that part for you.


CURL can:

  1. Follow redirect (set up as option)
  2. Store content (->curl_exec())

This is all your need to crawl. Used common methods, take examples from http://ua2.php.net/manual/en/function.curl-exec.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜