File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/API/STOCK_NEWS/V2NEW/AnnaounseResult.php
Back
<?php include_once("simple_html_dom.php"); $con = new mysqli("localhost","root","","market_data"); $i = 150; while($i > 0) { $html = file_get_html("https://www.moneycontrol.com/news/results-27.html/page-".$i."/"); $ul = $html->find('ul[id=cagetory]',0); $arr = array(); foreach($ul->find('li[class=clearfix]') as $li) { $h2 = $li->find('h2',0)->plaintext; $date = $li->find('span',0)->plaintext; $link = $li->find('a',0)->href; $a = array($h2,$date,$link); array_push($arr,$a); } $arr = array_reverse($arr); foreach($arr as $a) { $sql = "INSERT INTO `qresult` (`id`, `heading`, `date`, `link`) VALUES (NULL, '$a[0]', '$a[1]', '$a[2]');"; $con->query($sql); } $i = $i - 1; } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings