Sorry, if I posted a weird question. Now, I am explaining it properly.
I am trying to scrap a data from a web page say for example from: http://www.koolkart.com/nokia-lumia-800-p8251
I am trying to get price of the device listed in the table near "saholic" it is "Rs. 17759/-" and xpath to it is "//*[@id="price-chart"]/tbody/tr[1]/td[3]"
Now, when I execute the xpath in chrome, it gives the price with space
"
Rs. 17759/-
"
Now, when I execute it in php
<?php
$xpath = '//*[@id="price-chart"]/tbody/tr[1]/td[3]';
$html = new DOMDocument();
@$html->loadHTMLFile('http://www.koolkart.com/nokia-lumia-800-p8251');
$xml = simplexml_import_dom($html);
if (!$xml) {
echo 'Error while parsing the document';
exit;
}
echo $xml;
$source_image = $xml->xpath($xpath);
print_r($source_image);
?>
it gives error !
So, is there any solution how to remove those trailing spaces or any other way how to get that price?