Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $link = "https://free-proxy-list.net/?proxylisttable_length=300";
- $html = file_get_contents($link);
- $doc = new DOMDocument();
- libxml_use_internal_errors(true);
- $doc->loadHTML($html);
- libxml_clear_errors();
- $xpath = new DOMXPath($doc);
- $tables = $doc->getElementsByTagName('table');
- $kantal=20;//ambil sempaknya mau berapa (comming to get 300 rows)
- $sempak=array(0,1,2,6);//base of get sempak
- $index = 0;
- $column_1=0;$column_2=0;$column_3=0;$column_4=0;
- $nodes = $xpath->query('.//tbody/tr/td', $tables->item($sempak[0]));
- $nodes = $xpath->query('.//tbody/tr/td', $tables->item($sempak[1]));
- $nodes = $xpath->query('.//tbody/tr/td', $tables->item($sempak[2]));
- $nodes = $xpath->query('.//tbody/tr/td', $tables->item($sempak[3]));
- print $nodes->item($sempak[0])->nodeValue .$nodes->item($sempak[1])->nodeValue.$nodes->item($sempak[2])->nodeValue.$nodes->item($sempak[3])->nodeValue.$nodes->item(8)->nodeValue."<br/>";
- while ($index < $kantal) {
- //echo count($index);
- $angka_1=$sempak[0]+$kantal;
- $column_1=$angka_1+$column_1;
- $angka_2=$sempak[1]+$kantal;
- $column_2=$angka_2+$column_2;
- $angka_3=$sempak[2]+$kantal;
- $column_3=$angka_3+$column_3;
- $angka_4=$sempak[3]+$kantal;
- $column_4=$angka_1+$column_4;
- //echo $column_1;
- print $nodes->item($column_1)->nodeValue .$nodes->item($column_2)->nodeValue.$nodes->item($column_3)->nodeValue.$nodes->item($column_4)->nodeValue.$nodes->item(8)->nodeValue."<br/>";
- $index++;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment