jfoawn Posted February 8, 2011 Share Posted February 8, 2011 im trying to write a simple script. Pretty much to scrape a page content. maybe you can help me. This is what i got so far <?php $url = 'http://www.solecollector.com/forums/memberlist.php'; $output = file_get_contents($url); echo $output; ?> which works good. Now how could i have it navigate to the next page and run the script again, and do so untill it reaches the last page. Any help its appreciated or point me on the right direction. Link to comment https://forums.phpfreaks.com/topic/227012-navigation-function-and-re-run-script/ Share on other sites More sharing options...
Pikachu2000 Posted February 8, 2011 Share Posted February 8, 2011 What 'next page' are you referring to? Link to comment https://forums.phpfreaks.com/topic/227012-navigation-function-and-re-run-script/#findComment-1171299 Share on other sites More sharing options...
jfoawn Posted February 8, 2011 Author Share Posted February 8, 2011 next users page. I figured it out though. <?php $pages = 4277; # 4,277 pages of members $listsize = 50; # 50 users per page $lcv = 0; # Our Loop Control Variable while($pages>0){ $output = file_get_contents('http://www.solecollector.com/forums/memberlist.php?mode=joined&order=ASC&start='.$lcv); echo $output; $lcv = $lcv + $listsize; $pages--; } ?> Link to comment https://forums.phpfreaks.com/topic/227012-navigation-function-and-re-run-script/#findComment-1171305 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.