title: Scraping Data from NHL.com
body: <p>I'm trying to grab the table from <a href="http://www.nhl.com/ice/standings.htm?season=20112012&amp;type=LEA" rel="nofollow">http://www.nhl.com/ice/standings.htm?season=20112012&amp;type=LEA</a>, and store it into a MySQL database on my server. Using the below, I'm able to copy the website exactly, but I'm not sure how to just extract that table. Code below:</p>
  
  <p>Any ideas?</p>
  
  <pre><code>function get_data($url)
  {
    $ch = curl_init();
    $timeout = 5;
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
  }
  
  $returned_content = get_data('http://www.nhl.com/ice/standings.htm?season=20112012&amp;type=LEA');
  
  echo $returned_content;
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <pre><code>$html = file_get_html('http://www.nhl.com/ice/standings.htm?season=20112012&amp;type=LEA');
      $e = $html-&gt;find("table", 2);
  
      echo($e);
  </code></pre>
  
  <p>This code works, posts a table like the one I need. But Now I'm curious as to how I would go about stripping all unnecessary links/formatting and saving it to the database?</p>