I want to get the values inside tds. I can do it by getElementsByTagName but I could not manage it by using getElementById.
The HTML might look like this:
<table id="myid">
<tr>
<td>value1</td>
<td>value2</td>
</tr>
<tr>
<td>value1</td>
<td>value2</td>
</tr>
</table>
The php used to access the values is:
<?PHP
$dom = new DOMDocument();
$dom->loadHTMLfile('http://remoteDomain/thispage.html');
$table=$dom->getElementById('myid');
foreach($table->getElementsByTagName('tr') as $key =>$tr){
$tr->getElementsByTagName('td')->item(0)->nodeValue;
}
?>
EDIT
I got the error: Fatal error: Call to a member function getElementsByTagName() on a non-object in ...
EDIT2
Php info:
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.7.3
Operating system: Windows