PHP: 下载网页的方法

php.gif用PHP抓取网页有多种方式。本人目前的经验:

  1. 用PHP 自带的函数

比如file,file_get_contents等等

2. 用curl的php绑定

好处是可以支持cookie

3.  使用Snoopy类库

下一个项目可以试一下:

Snoopy is a PHP class that simulates a web browser. It automates the task of retrieving web page content and posting forms, for example.

本文由IT Farmer的博客创作,欢迎转载并保留对本博的链接。 Tags:,

Leave a Reply