title: how can i use xpath to grab content from a curl response -- Notice: Trying to get property of non-object
body: <p>okay so i have the source code from a website i am trying to grab this info 0.00 from the following source code:</p>
  
  <pre><code>&lt;div class="row"&gt;
  &lt;div class="span10"&gt;
  &lt;div id="conn_status"/&gt;&lt;br/&gt;
  &lt;div id="balance_notifications"/&gt;
  
  
  
  
  
  &lt;/div&gt;
  &lt;/div&gt;
  
  
  
  &lt;center&gt;
  
  
  
  &lt;h2&gt;0 RLM
  (0.00 USD)&lt;/h2&gt;
  </code></pre>
  
  <p>i want to be able to grab both the 0 RLM value the 0 does change 
  and i also want to grab the 0.00 usd part i only need the numbers to display in echo output in my php file </p>
  
  <p>here what i have so far </p>
  
  <pre><code>&lt;?php
     function check($url2){
      $check = curl_init();
      curl_setopt($check, CURLOPT_COOKIEJAR, 'cookiemon.txt');
      curl_setopt($check, CURLOPT_COOKIEFILE, 'cookiemon.txt');
      curl_setopt($check, CURLOPT_TIMEOUT, 40000);
      curl_setopt($check, CURLOPT_RETURNTRANSFER, TRUE);
      curl_setopt($check, CURLOPT_URL, $url2);
      curl_setopt($check, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
      curl_setopt($check, CURLOPT_FOLLOWLOCATION, false);
  return curl_exec ($check);
  curl_close ($check);
  
  
  } 
  $html = check('https://example.org/');
  $dom = new DOMDocument();
  @$dom-&gt;loadHTML($html);
  $xpath = new DOMXPath($dom);
  $value = $xpath-&gt;query('//label[@id="balance_notifications"]/following-sibling::text()')-&gt;item(0)-&gt;nodeValue;
  ?&gt;
  </code></pre>
  
  <p>and this is the php response i get </p>
  
  <p>Notice: Trying to get property of non-object in /opt/lampp/htdocs/newphp.php on line 20</p>