here is the code which I am using to extract data:
ini_set("user_agent","Opera/9.80 (Windows NT 6.1; U; Edition Campaign 21; en-GB) Presto/2.7.62 Version/11.00");
$html14=file_get_html("https://www.gamesrocket.com/battlefield-1.html");
$title14 = $html14->find('span.price',0)->children(0)->plaintext;
for ($i=0; $i <sizeof($title14) ; $i++) {
# code...
if($title14[$i]){
echo $title14[$i]->plaintext;
$a13=$title14[$i]->plaintext;
}
else{
echo "problem";
}
}
Here I am trying to extract price from the given page but all I am getting this error : Trying to get property of non-object
.I am using simple html dom for extracting data