je dois gratter cette page HTML ...Obtenez Xpath pour les éléments HTML de la page Web .asp
http://www.asl1.liguria.it/templateProntoSoccorso.asp
.... en utilisant PHP et XPath pour obtenir les valeurs comme 2
Codice bianco:
(NOTE: vous pouvez voir la valeur différente s dans cette page si vous essayez de le parcourir ... il n'a pas d'importance .. ,, ils changent dinamically ....)
Je ne peux pas obtenir le XPath pour ces valeurs en utilisant Mozilla Firebug comme d'habitude je faire: des suggestions?
Merci d'avance!
MISE À JOUR
<?php
ini_set('display_errors', 1);
$url = 'http://www.asl1.liguria.it/templateProntoSoccorso.asp';
$ch = curl_init();
curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_PROXY, '');
$data = curl_exec($ch);
curl_close($ch);
$dom = new DOMDocument();
@$dom->loadHTML($data);
$xpath = new DOMXPath($dom);
$Number = $xpath->query('/html/body/table/tbody/tr/td[2]/table[2]/tbody/tr/td[3]/table/tbody/tr[2]/td[1]/table/tbody/tr/td/div[1]/div[3]/div[2]');
foreach($Number as $node)
{
echo "Number: " .$node->nodeValue;
echo '<br>';
echo '<br>';
}
?>
Notez que [le développement de Firebug est arrêté] (https://hacks.mozilla.org/2016/12/firebug-lives-on-in-firefox-devtools/) en faveur des outils de développement intégrés de Firefox. –