Skip to content

Commit

Permalink
Update scraper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
vikash12345 committed Feb 9, 2018
1 parent 3a1a215 commit a419171
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions scraper.php
Expand Up @@ -2,26 +2,24 @@
require 'scraperwiki.php';
require 'scraperwiki/simple_html_dom.php';

$years = array('2000');
$years = array('1950');

for ($mainpage = 0; $mainpage < sizeof($years); $mainpage++)
{
$x = 1;
$link = 'http://supremecourtofindia.nic.in/php/case_status/case_status_process.php?d_no='.$x.'&d_yr='.$years[$mainpage];
$html = file_get_html($link);
$check = $html->find("h5[plaintext^=Diary No]",0)->plaintext;
$linkabc = 'http://supremecourtofindia.nic.in/php/case_status/case_status_process.php?d_no='.'1'.'&d_yr='.$years[$mainpage];
$html = file_get_html($linkabc);
$check = $html->find("h5[plaintext^=Diary No]",0)->plaintext;
$x = 1;
while($check != null || $check != "")
{
foreach($html->find("/html/body")as $element)
{
$link = 'http://supremecourtofindia.nic.in/php/case_status/case_status_process.php?d_no='.$x.'&d_yr='.$years[$mainpage];
$html = file_get_html($link);
$check = $html->find("h5[plaintext^=Diary No]",0)->plaintext;
$record = array( 'check' =>$check, 'link' => $link);
scraperwiki::save(array('check','link'), $record);
echo "$check\n";
$x++;
}


}

}
?>

0 comments on commit a419171

Please sign in to comment.