For parsing you can use HTML DOM to retrieve data , Like you can load DOM and can iterate the nodes as per your need for example
$doc = new DOMDocument();
// Get the sourcecode of the domain
@$doc->loadHTMLFile($domain);
//here we are collecting all div tags from web page
$div = $doc->getElementsByTagName('div');
foreach($books as $div)
{
$class = $div->getAttribute('class');
if (strpos($class, 'price') !== false)
{
echo $class->nodeValue;
}
}
For more understanding you can see this Answer.
you also can use this script .
http://sourceforge.net/projects/simplehtmldom/files/