J'utilise le composant Zend Dom pour analyser certains blocs Html, mais j'ai des problèmes pour extraire l'a, b, c, d, e, les données f du bloc suivant:Parse html avec 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>
Code:
$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');
Veuillez clarifier ce qui ne fonctionne pas et quelle sortie vous attendez. – Gordon