How to go through pagination with a crawler?
<p>i have made a crawler, but i can´t understand how i can go through a pagination, can someone please help me with this, thanks.</p>

<p>Here is my crawler script:</p>

<pre>

    if(!$fp = fopen("https://market.android.com/details?id=apps_topselling_paid&cat=LIBRARIES_AND_DEMO&start=0&num=24" ,"r" )) {
        return false;
    }
    $content = "";

    while(!feof($fp)) {
        $content .= fgets($fp, 1024);
    }
    fclose($fp);

    if (!preg_match('/error-section/i', $content)) {
      preg_match_all("/id=([^/i", $content, $matches, PREG_SET_ORDER);

      $i=1;
      foreach ($matches as $val) {

          $link = $val[1];

          if(!$fps = fopen("https://market.android.com/details?id=". $link ,"r" )) {
            return false;
          }
          $content_app = "";

          while(!feof($fps)) {
            $content_app .= fgets($fps, 1024);
          }
          fclose($fps);

          preg_match("/([^/i", $content_app, $regs);
          echo $regs[1]. "<br />;

      }
    }else{
      echo 'Error page not found!';
    }

</pre>
