title: Simple HTML DOM - traversing html
body: <p>I'm using the Simple HTML DOM Parser - <a href="http://simplehtmldom.sourceforge.net/manual.htm" rel="nofollow">http://simplehtmldom.sourceforge.net/manual.htm</a>
  I'm trying to scrape some data from a scoreboard page. The below example shows me pulling the HTML of the "<a href="http://espn.go.com/ncf/boxscore?gameId=322432006" rel="nofollow">Akron Rushing</a>" table.</p>
  
  <p>Inside <code>$tr-&gt;find('td', 0)</code>, the first  column, there is a hyperlink. How can I extract this hyperlink? Using <code>$tr-&gt;find('td',    0')-&gt;find('a')</code> does not seem to work. </p>
  
  <p>Also: I can write conditions for each table (passing, rushing, receiving, etc), but is there a more efficient way to do this? I'm    open to ideas on this one.</p>
  
  <pre><code>include('simple_html_dom.php');
  $html = file_get_html('http://espn.go.com/ncf/boxscore?gameId=322432006');
  
  $teamA['rushing'] = $html-&gt;find('table.mod-data',5);
  
  foreach ($teamA as $type=&gt;$data) {
    switch ($type) {
      # Rushing Table
      case "rushing":
         foreach ($data-&gt;find('tr') as $tr) {
          echo $tr-&gt;find('td', 0);    // First TD column (Player Name)
          echo $tr-&gt;find('td', 1);    // Second TD Column (Carries)
          echo $tr-&gt;find('td', 2);    // Third TD Column (Yards)
          echo $tr-&gt;find('td', 3);    // Fourth TD Column (AVG)
          echo $tr-&gt;find('td', 4);    // Fifth TD Column (TDs)
          echo $tr-&gt;find('td', 5);    // Sixth TD Column (LGs)
          echo "&lt;hr /&gt;";
          }
     }
  }
  </code></pre>