I already build a script to scrape or extract data from a website using xpath. It runs succesfully without any error displayed yet I didn’t get the value or prints text.
Here’s the code:
[php]$dom = new DOMDocument();
$dom->loadHTML($Url);
$xpath = new DomXPath($dom);
$nodes = $xpath->query(’//span[@style=“font-size:25px; color:#98293D”]’);
foreach ($nodes as $node) {
echo $node->nodeValue;
}[/php]
Can you verify it if there’s any wrongdoing I’ve done.
Here’s the source of the selected element I want to scrape to.
[code]p data-iceapw=“6” data-iceapc=“3”>
<span style="font-size:25px; color:#98293D;" data-iceapw="2"></span>
<br></br>
<span style="font-size:25px; color:#98293D;" data-iceapw="2"></span>
<br></br>
<span style="font-size:25px; color:#98293D;" data-iceapw="2"></span>
[/code]
I hope I would given an answer in the shortest span.
Regards.