For easiest understanding, I will add my function
$client = new Client();
$crawler = $client->request('GET', 'http://novidom.ba/offer/iznajmljuje-se-stan-u-prizemlju-kuce-midzic-mahala-bihac/775');
$meta = $crawler->filter('meta')->each(function($node) {
return [
'name' => $node->attr('name'),
'property' => $node->attr('property'),
'content' => $node->attr('content'),
];
});
return $meta;
On this way I can return all meta tags in JSON (later I will made function that saves this data in database).
I've tried with this function return all links, but I have a problem with pagination and it returns about 80 results, but I know that this should be about 1000 results (as I already said, pagination is the problem).
$url = "http://novidom.ba/offer/";
$client = new Client();
$crawler = $client->request('GET', $url);
$links_count = $crawler->filter('a')->count();
$all_links = [];
if($links_count > 0){
$links = $crawler->filter('a')->links();
foreach ($links as $link) {
$all_links[] = $link->getURI();
}
$all_links = array_unique($all_links);
echo "All Avialble Links From this page $url Page<pre>"; print_r($all_links);echo "</pre>";
} else {
echo "No Links Found";
}
die;