title: get specific portion of html source with cUrl - cUrl problems retrieving right content, curl_setopt($ch, CURLOPT_URL,$url);
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3577641/how-to-parse-and-process-html-with-php">How to parse and process HTML with PHP?</a>  </p>
  </blockquote>
  
  
  
  <p>i'm building my website with presentations off different products, and i face a few problems using curl
  basically what i need to do is to get some portions of html from different websites and display on my website ex: title, model, description, user reviews etc....
  i managed to accomplish some of the code but when changing the source url stop working... even the source is the same
  my code:</p>
  
  <pre><code>$url = "http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=2819129&amp;CatId=4938";
  
  //$url = "http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=1808177&amp;csid=_61"; //this one is not working....
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL,$url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
  
  $source = curl_exec ($ch);
  
  $start_description1 = "&lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  
  
  
  
  &lt;p&gt;";
  $end_description1 = "&lt;/div&gt;
  &lt;/div&gt;
  &lt;div id=\"Videos\" style=\"display:inline;\"&gt;";
  $description1_start_pos = strpos($source, $start_description1) + strlen($start_description1);
  $description1_end_pos = strpos($source, $end_description1) - $description1_start_pos;
  $description1 = substr($source, $description1_start_pos, $description1_end_pos);
  echo $description1;
  </code></pre>
  
  <p>it works perfect but if i change the url it won't work...
  the problem is the start_description html code...
  on other pages the html code differs...</p>
  
  <p>instead of:</p>
  
  <pre><code>&lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  
  
  
  
  &lt;p&gt;
  </code></pre>
  
  <p>new page have:</p>
  
  <pre><code>&lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  
  
  &lt;p&gt;
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>&lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  
  &lt;p&gt;
  </code></pre>
  
  <p>how can i avoid this error? or what to do to avoid cUrl errors, and retrieve the content i want ?</p>
  
  <p>thank you!</p>