/
scraper.php
47 lines (40 loc) · 1.71 KB
/
scraper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?
// This is a template for a PHP scraper on morph.io (https://morph.io)
// including some code snippets below that you should find helpful
// Roll No Start - > 300001
// Roll No End - > 300001
// PDF Link - > https://www.fbise.edu.pk/notifications/hssc/HSSC-I-A%202017%20Gazette.pdf
// search url - > https://www.fbise.edu.pk/res-hssc-II.php
/*
Created by Vikash
Date of Creation 4/28/2018
Email vikashbaria4@gmail.com
skype vikashharjeewan2@Hotmail.com
Expert in web Scraping,Web automation,Investigation research and databases,
*/
require 'scraperwiki.php';
require 'scraperwiki/simple_html_dom.php';
for($page = 500001;$page <= 597006; $page++)
{
$link = 'https://www.fbise.edu.pk/linkrollno-hssc-11.php?roll_no='.$page;
echo "$page\n";
$browser = file_get_html($link);
if($browser)
{
$nameofresult = $browser->find("//*[@id='item']/table[1]/tbody/tr/td/font/b",0)->plaintext;
$rollno = $browser->find("//*[@id='item']/table[2]/tbody/tr[1]/td[2]",0)->plaintext;
$name = $browser->find("//*[@id='item']/table[2]/tbody/tr[2]/td[2]",0)->plaintext;
$fname = $browser->find("//*[@id='item']/table[2]/tbody/tr[3]/td[2]",0)->plaintext;
$result = $browser->find("//*[@id='item']/table[2]/tbody/tr[4]/td[2]",0)->plaintext;
$remarks = $browser->find("//*[@id='item']/table[2]/tbody/tr[5]/td[2]",0)->plaintext;
$record = array( 'rollno' =>$rollno,
'nameofresult' => $nameofresult,
'name' => $name,
'fname' => $fname,
'result' => $result,
'remarks' => $remarks,
'link' => $link);
scraperwiki::save(array('rollno','nameofresult','name','fname','result','remarks','link'), $record);
}
}
?>