Hey guys,
Can't seem to wrap my head around this. This is what I have:
$husdjur = new DOMDocument();
@$husdjur->loadHTML("test.html");
$xpath = new DOMXPath($husdjur);
$tableRows = $xpath->query('/html/body/table/tbody/tr[1]/td[1]');
print_r($tableRows);
And this is what I get:
DOMNodeList Object ( )
Here is a sample of test.html (in this case, I am going after the "5166" entry, this file is massive):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0077)https://xxxxxxxxxxx.net/api/excel/usagequantities?period=300d&format=html -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">TABLE.responsedata { font-family: Calibri, Arial, monaco, monospace; font-size: 11pt } TABLE.responsedata,TABLE.responsedata TD { border: *snip*</style>
</head>
<body>
<table class="responsedata">
<thead>
<tr>
<th>Ärendenr</th>
<th>Status</th>
<th>Ärende skapat datum</th>
<th>Skapad av</th>
<th>Ändrad</th>
<th>Ändrad av</th>
And so on, 50 something more...
</tr>
</thead>
<tbody>
<tr>
<td>5166</td>
<td>Avslutad</td>
<td style="mso-number-format:'yyyy-mm-dd hh:mm';">2012-10-08 10:27</td>
<td>Name1</td>
<td style="mso-number-format:'yyyy-mm-dd hh:mm';">2012-10-08 10:27</td>
<td>Name2</td>
<td>K8 norr städ</td>
And so on, 50 something more...
Any help much appreciated, cheers!