博客导读网 |
一个让你随便看看的地方 |
简单php爬虫程序推荐Linux Pig - 探讨Linux相关技术的博客 |
||
|
<?php $pattenURL = '@http:\/\/[\w|\/|\.]+@'; $resultURL = array(); $visitedURL = array(); function getData($startURL,$level){ global $pattenURL; global $resultURL; global $visitedURL; //if the url is a image, don`t get the content, just Record it in the Result Array $ptn2 = '@http:\/\/[\w|\/|\.]+[\.gif|\.jpg|\.jpeg|\.png]$@'; if( preg_match($ptn2,$startURL) | empty($startURL) )return; if(in_array($startURL,$visitedURL)) return; array_push($visitedURL,$startURL); [...] |
||
| 原文地址:http://www.linuxpig.com/2011/11/php-craler/ |
| © 2010 博客导读网 BlogABC.NET 本站所有内容皆由网友推荐而来,所有博文的版权归原作者所有,如有冒犯,请邮件告知。uncracker#gmail.com |