dammyg Posted July 19, 2008 Share Posted July 19, 2008 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 More sharing options...
MadTechie Posted July 20, 2008 Share Posted July 20, 2008 And the problem is ? Link to comment https://forums.phpfreaks.com/topic/115631-bulk-leeching-data-on-similar-pages/#findComment-594556 Share on other sites More sharing options...
dammyg Posted July 20, 2008 Author Share Posted July 20, 2008 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; } Link to comment https://forums.phpfreaks.com/topic/115631-bulk-leeching-data-on-similar-pages/#findComment-594902 Share on other sites More sharing options...
MadTechie Posted July 21, 2008 Share Posted July 21, 2008 Okay... And the problem is ? PS. your not using that function! Link to comment https://forums.phpfreaks.com/topic/115631-bulk-leeching-data-on-similar-pages/#findComment-595351 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.