I need to scrape a length of text from a webpage from the internet, I am using the dom and xpath to find the data, however I cant seem to select the exact information I need. He
Your XPath is fine when I use it in Firefox, but it won't work with DOM, which is not surprising. I assume you got your XPath from some sort of browser plugin able to return the path for certain elements. However, you should not trust XPaths returned by browser plugins because browsers will modify the DOM through JavaScript and add implied values where necessary. Use the raw sourcecode instead.
Your XPath evaluates to "Home delivery within 2 days" in Firefox, which is not what I would expect in a variable called "stock_data". But anyway, this should do it:
$dom = new DOMDocument;
libxml_use_internal_errors(TRUE);
$dom->loadHTMLFile('http://www.argos.co.uk/static/Product/partNumber/9282197/Trail/searchtext%3EIPOD+TOUCH.htm');
libxml_clear_errors();
$xpath = new DOMXpath($dom);
$nodes = $xpath->query(
'/html/body//div[@id="deliveryInformation"]/ul/li[@class="home"]/span'
);
echo $nodes->item(0)->nodeValue; // "Home delivery within 2 days"