H4T3D

businessdirectory Email Extractor H4T3D

Oct 15th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php
  2.  
  3. //http://www.businessdirectory.pk/Default.aspx?action=Business&pid=307880&cityid=279285&page=316
  4.  
  5.  
  6.  
  7.  
  8. ?>
  9.  
  10.  
  11. <?php
  12.   set_time_limit(0);
  13.  // error_reporting(0);
  14.  
  15.   $myfile = fopen("Business_emails.txt", "w") or die("Unable to open file!");
  16.  
  17.   echo "<ol>";
  18. for($i = 0 ; $i<=316 ; $i++){
  19.  
  20.  $result = file_get_contents("http://www.businessdirectory.pk/Default.aspx?action=Business&pid=307880&cityid=279285&page=".$i);
  21.  
  22.  
  23. //echo $login;
  24. // <td style="width: 70%;"></td>
  25.  
  26.  
  27. preg_match_all("/<p class='email'>(.*?)<\/p>/s",$result,$matches);
  28.  
  29. //print_r($matches);
  30.  
  31.     $h4t3d=array_unique($matches[1]);
  32.  
  33.     foreach ($h4t3d as $ul){
  34.     echo "<li>".$ul."</li>";
  35.     fwrite($myfile, $ul."\n");
  36.     flush();
  37.     @ob_flush();
  38.     }
  39.  
  40. flush();
  41. @ob_flush();
  42.  
  43. }
  44.  
  45. fclose($myfile);
  46. echo "</ol>";
  47.  
  48.  
  49. ?>
Add Comment
Please, Sign In to add comment