0
I는 일부 HTML 블록을 파싱 젠드 돔 컴포넌트를 사용하고 있지만 문제 추출을 갖는 A, B, C, D, E, 다음 블록으로부터 F 데이터 :파싱 HTML과 젠드 돔
<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