In general, a simple, simple parser that works only at the top of the page. Google said that it is necessary to use $ start and $ finish, but if I prescribe them nothing at all parsitsya. The donor site has the following structure:
<div class="firm-list-item firm-place-1">~контент который нужно забрать~</div> <div class="firm-list-item firm-place-2">~контент который нужно забрать~</div> <div class="firm-list-item firm-place-2">~контент который нужно забрать~</div> Between 1 and 2 divs the content is taken, and then there is no .. Here is the code of the parser itself:
$title=file_get_contents($url); $start = '<div class="firm-list-item firm-place-2">'; $finish = '<div class="firm-list-item firm-place-3">'; $pos=strpos($title,'<a class="firm-item-title" href='); $title=substr($title,$pos); $pos1=strpos($title,'</a>'); $title=substr($title,0,$pos1); $title=preg_replace('<a class="firm-item-title" href="/firm/id/[0-9]+/">','',$title); echo $title; echo '<br>'; Tell me, please, what is the problem here (where to write $ start and $ finish?).