0
我使用Zend的Dom成分解析一些HTML塊,但是我有提取問題的A,B,C,d,E,從下面的F座數據:解析HTML與Zend的Dom
<div id="center">
<form action="" method="get">
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</form>
<table>
<tr>
<td align="center"><b>a</b></td>
<td align="left"><b>b</b>
<br />c
<br />d
</td>
<td align="left"><b>e<br />
f<br />
g
</b>
</td>
</tr> <!-- this block repeats 10 times with other values instead of a,b,c...-->
</table>
</div>
代碼:
$client = new Zend_Http_Client();
$client->setUri('http://example.com');
$response = $client->request();
$html = $response->getBody(); // the Html is the example above
$dom = new Zend_Dom_Query($html);
$results = $dom->query('#center table tr td');
請澄清什麼是不工作,你期望得到什麼輸出。 – Gordon 2012-02-17 12:08:37