High score! PHP web page crawling problem www. zootoo. competnewscanineheroesamemorialdaysalute-1612www.zootoo.competnewshailtothecatsasalutetofirstfel-1611www.zootoo.competnewsmothe high score! Web page crawling in PHP
Http://www.zootoo.com/petnews/canineheroesamemorialdaysalute-1612
Http://www.zootoo.com/petnews/hailtothecatsasalutetofirstfel-1611
Http://www.zootoo.com/petnews/mothersdaygiftsforthepetloving-1592
For example
The first one is paging content, without paging
What should I do if I need to capture the body?
PHP is not very familiar with, high score for advice, thank you
------ Solution --------------------
Leave an email. I will give you an example.
------ Solution --------------------
PHP code
header("Content-type:text/html;charset=utf-8");$url="http://www.zootoo.com/petnews/hailtothecatsasalutetofirstfel-1611"; $contents=file_get_contents($url);$contents=preg_replace('/>(\s+)/','>',$contents);$contents=str_replace("\r\n",'',$contents);$contents=str_replace("\t",'',$contents);//echo $contents;preg_match_all('~(.*?)
(.*?)~is',$contents,$p);print_r($p[1]);print_r($p[2]);