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. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted February 8, 2011 Share Posted February 8, 2011 What 'next page' are you referring to? Quote Link to comment 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--; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.