High score! PHP web page crawling problems

Source: Internet
Author: User
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]);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.