J'essaie de récupérer des informations à partir d'un site Web en utilisant PHP Simple HTML Dom Parser. Dans le site il ya beaucoup de tables avec la classe "forumborder2" et à l'intérieur je veux obtenir des informations. Dans l'exemple suivant, je veux la source de l'image.PHP - Simple HTML Dom Parser
<table class="forumborder2" width=100% cellspacing=0 cellpadding=0 border=0 align=center>
<tr>
<td class="titleoverallheader2" background="modules/Forums/templates/chunkstyle/imagesnew/forumtop.jpg" style="border-top:0px; border-left:0px; border-right:0px;" width="100%" colspan=7 Align=left>
<b>Supernatural </b>(2005) - Enviada por: <b>AlJoSi</b> em 6 de Dezembro, 2011 (22:35:11)
</td>
</tr>
<tr height=25>
<td class="colour12" align=right width=100>
<b>Idioma:</b>
</td>
<td width=110 class="colour22">
<img src="modules/Requests/images/fPortugal.png" width=18 height=12 border=0 alt='' title=''>
</td>
</tr> </table>
j'ai fait ce qui suit:
foreach($html->find('table[class="forumborder2"]')as $tr){
echo $tr->children(1)->children(1)->src; }
Cela donne toujours l'erreur: "Essayer d'obtenir la propriété de non-objet". Si je vais seulement à $tr->children(1)->children(1)
je peux obtenir <img src="modules/Requests/images/fPortugal.png" width=18 height=12 border=0 alt='' title=''>
alors pourquoi je ne peux pas accéder à l'attribut src.
Qu'est-ce que "simple analyseur dom HTML"? Et ** quelle erreur ** ??? – Jon
@Jon, [Parseur PHP Simple HTML DOM] (http://simplehtmldom.sourceforge.net/). Changé le message avec l'erreur aussi. – Barata