Jump to content

Navigation function and re run script?


jfoawn

Recommended Posts

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

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--;

 

    }

    ?>

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.