获取错误尝试在简单的html dom中获取非对象的属性

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

because $title14 is string and not object, you can var_dump($title14); to know the type of it.

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++) { 

   if($title14[$i]){
   echo $title14[$i];
   $a13=$title14[$i];
   }
  else{

    echo "problem";
}

}