J'aller chercher je utilise cet exemple pour aller chercher des liens d'un site Web:Xpath php liens
http://www.merchantos.com/makebeta/php/scraping-links-with-php/
$xpath = new DOMXPath($dom);
$hrefs = $xpath->evaluate("/html/body//a");
for ($i = 0; $i < $hrefs->length; $i++) {
$href = $hrefs->item($i);
var_dump($href);
$url = $href->getAttribute('href');
echo "<br />Link stored: $url";
}
Il fonctionne bien; obtenir tous les liens; mais je ne peux pas obtenir le «titre» réel du lien; par exemple si j'ai:
<a href="www.google.com">Google</a>
Je veux être capable d'aller chercher le terme 'Google' aussi. Je suis un peu perdu et tout nouveau à xpath.