Вот рабочий пример. Тут все поймете.
<?php
require_once('shd/simple_html_dom.php');
//Получаем HTML код нужной нам страницы
$html = new simple_html_dom();
$i = 1;
$cnt = 10;
while($i <= $cnt){
$html->clear();
unset($html);
$link = 'http://stavropol.mirstroek.ru/companies/page'.$i.'/';
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
$html = str_get_html($res);
curl_close($ch);
$categories = $html->find('ul.company_list li');
if (isset ($categories)) {
foreach ($categories as $course){
sleep(1);
$categories1 = $course->find('a',0)->href;
$ch = curl_init($categories1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
$one = str_get_html($res);
curl_close($ch);
if (method_exists($one, "find")){
if($one->find('table.stripy')){
$one1=$one->find('table.stripy tr');
foreach ($one1 as $course1){
//sleep(1);
if ($course1->find('td',0)->outertext=='<td><span>E-mail</span></td>'){
$bik = $course1->find('td',1)->plaintext;
echo $bik . '<br>';
}}
}}
}
}
$i++;
}
?>