Advertisement
victor243

getlinks

Dec 11th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2.         ini_set('MAX_EXECUTION_TIME', -1);
  3. include_once("simple_html_dom.php");
  4.     $url = "http://santhuoc.vn/page/";
  5. for ($i=1; $i<=1000; $i++){
  6.          $pagesurl = $url.$i;
  7.      $html = file_get_html($pagesurl);
  8.  preg_match_all ("/a[\s]+[^>]*?href[\s]?=[\s\"\']+"."(.*?)[\"\']+.*?>"."([^<]+|.*?)?<\/a>/", $html, $matches);
  9.     $matches = array_unique($matches[1]);  
  10.       $list = array();
  11. foreach($matches as $html)
  12.     {  
  13.     echo $html;
  14. }
  15.   }
  16.     ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement