H4T3D

Bolee Numbers Extractor

Oct 15th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1. <?php
  2.  
  3. //www.phonebook.com.pk/dynamic/search.aspx?searchtype=cat&class_id=1131&page=2
  4.  
  5.  
  6.  
  7.  
  8. ?>
  9.  
  10.  
  11. <?php
  12.   set_time_limit(0);
  13.   $temp="";
  14.  // error_reporting(0);
  15.   echo "<ol>";
  16. for($i = 0 ; $i<=59 ; $i++){
  17.  
  18.  $result = file_get_contents("http://karachi.bolee.com/nf/search-p-".$i."/computer-services");
  19.  
  20.  
  21. //echo $login;
  22. // <td style="width: 70%;"></td>
  23.  
  24.  
  25. preg_match_all('#http://karachi.bolee.com/detail/(.*?)"#', $result, $matches);
  26.  
  27. foreach ($matches[1] as $key => $value) {
  28.    
  29.  if ($temp != $value)
  30. {
  31. echo "<li>".$value."</li>";
  32.  
  33. $temp = $value;
  34.  
  35.  $links = file_get_contents("http://karachi.bolee.com/detail/".$value);
  36.  
  37.  
  38. preg_match_all('#<span class="pull-right">(.*?)</span>#', $links, $matchess);
  39.  
  40.  
  41. echo "<li>".$matchess[0][0]."</li>";
  42.  
  43. $myfile = fopen("sms_no.txt", "a") or die("Unable to open file!");
  44. fwrite($myfile,$matchess[1][0]."\n");
  45. fclose($myfile);
  46.  
  47.  
  48.  
  49.  flush();@ob_flush();
  50.      
  51.       }
  52.   }
  53.  
  54.                 flush();
  55.                 @ob_flush();
  56.  
  57. }
  58. echo "</ol>";
  59.  
  60. //[email protected] (For Any Type Of Web Scraping and Data Mining)
  61. ?>
Add Comment
Please, Sign In to add comment