I would suggest using the PHP Simple HTML DOM . I myself used it for anything, starting from scripting a page and manipulating HTML template files, and very simple and powerful enough, and should meet your requirements.
, , :
$html = file_get_html('http://www.google.com/');
foreach($html->find('img') as $element)
echo $element->src . '<br>';
foreach($html->find('a') as $element)
echo $element->href . '<br>';