<?php
$html = <<<EOF
<table>
<thead>
<tr>
<th>Col 1</th>
<th>Col 2</th>
<th>Col 3</th>
<th>Col 4</th>
<th>Col 5</th>
<th>Col 6</th>
</tr>
</thead>
<tbody>
<tr>
<td>Conteudo 1</td>
<td>Conteudo 2</td>
<td>Conteudo 3</td>
<td>Conteudo 4</td>
<td>Conteudo 5</td>
<td>Conteudo 6</td>
</tr>
<tr>
<td>Conteudo 1</td>
<td>Conteudo 2</td>
<td>Conteudo 3</td>
<td>Conteudo 4</td>
<td>Conteudo 5</td>
<td>Conteudo 6</td>
</tr>
</tbody>
</table>
EOF;
// criar um novo documento
$document = new DOMDocument();
// ler o html
$document->loadHTML($html);
// criar seletor xpath
$selector = new DOMXPath($document);
//selecionar conteudo das td's
$results = $selector->query('//td');
// resultado
foreach($results as $node) {
echo $node->nodeValue . PHP_EOL;
}
PD9waHAKJGh0bWwgPSA8PDxFT0YKPHRhYmxlPgo8dGhlYWQ+Cjx0cj4KPHRoPkNvbCAxPC90aD4KPHRoPkNvbCAyPC90aD4KPHRoPkNvbCAzPC90aD4KPHRoPkNvbCA0PC90aD4KPHRoPkNvbCA1PC90aD4KPHRoPkNvbCA2PC90aD4KPC90cj4KPC90aGVhZD4KPHRib2R5Pgo8dHI+Cjx0ZD5Db250ZXVkbyAxPC90ZD4KPHRkPkNvbnRldWRvIDI8L3RkPgo8dGQ+Q29udGV1ZG8gMzwvdGQ+Cjx0ZD5Db250ZXVkbyA0PC90ZD4KPHRkPkNvbnRldWRvIDU8L3RkPgo8dGQ+Q29udGV1ZG8gNjwvdGQ+CjwvdHI+Cjx0cj4KPHRkPkNvbnRldWRvIDE8L3RkPgo8dGQ+Q29udGV1ZG8gMjwvdGQ+Cjx0ZD5Db250ZXVkbyAzPC90ZD4KPHRkPkNvbnRldWRvIDQ8L3RkPgo8dGQ+Q29udGV1ZG8gNTwvdGQ+Cjx0ZD5Db250ZXVkbyA2PC90ZD4KPC90cj4KPC90Ym9keT4KPC90YWJsZT4KRU9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