Jump to content

bulk leeching data on similar pages


dammyg

Recommended Posts

Hi, I am looking to bulk leech data from one site at a time from multiple pages on the site which all have the same layout so can get data between strings, any help will be much appreciated.

 

eg:

 

www.site.com/code1.html

www.site.com/code2.html

www.site.com/code3.html

www.site.com/code4.html

...

 

all with data like below:

 

#

description:

 

code1 is blah blah

 

end

#

 

Thank You

Link to comment
https://forums.phpfreaks.com/topic/115631-bulk-leeching-data-on-similar-pages/
Share on other sites

Hi, sorry here is the code, think I got a bit mixed up somewhere:

 

$sitename = ($_GET['site']);
$text = file_get_contents("$sitename", "r");

function get_between($text,$s1,$s2) {
      echo "s1".$s1;
      echo "s2".$s2;
      echo "text".$text;
      echo "midurl".$midurl;  
	$mid_url = "";
      $pos_s = strpos($text,$s1);
      $pos_e = strrpos($text,$s2);
      if ($pos_e < $pos_s){$pos_e = 99999;}
      echo "poss:".$pos_s;
      echo "pose:".$pos_e;

      for ( $i=$pos_s+strlen($s1) ; (( $i<($pos_e)) && $i <strlen($text)) ; $i++ ) {
      $mid_url .= $text[$i];
      }
      
      return $mid_url;
      }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.