High score! PHP web crawling problem http://www.zootoo.com/petnews/canineheroesamemorialdaysalute-1612http://www.zootoo.com/petnews/hailtothecatsasalutetofirstf 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]);