I'm having a go scraping a page with [simple\_html\_dom](http://simplehtmldom.sourceforge.net/). On the page I'm scraping, there's a table with rows, and inside those, a bunch of cells. I'm wanting to get stuff in the third cell in each row. The cell in question doesn't have a class.

```
<tr class="thisrow">
  <td class="firstcell"><strong>1st</strong></td>
  <td class="secondcell">nothing in here</td>
  <td><strong>blah blah</strong></td>
  <td>something else</td>
</tr>

```

So to get started, I went straight for the third cell:

```
foreach($html->find('tr.thisrow td:nth-child(3)') as $thirdcell) {
    echo $thirdcell->innertext // this works, no problem!
}

```

But then I realised I needed some data in another cell in the row (td.firstcell). This cell has a class, so I thought best to loop through the rows, then use selectors within the context of that row:

```
foreach($html->find('tr.thisrow') as $row) {

    $thirdcell = $row->find('td:nth-child(3)');
    echo $thirdcell; // this is now empty

    $firstcell = $row->find('td.firstcell');
    echo $firstcell; // this works!

}

```

So as you can see, my nth-child selector suddenly inside the context of the row loop is not working. What am I missing?