Goutte
Goutte copied to clipboard
How to pick href link and text or complete element
$noticia = $noticias->filter('article > div > h4 > a')->each(function ($response) { return $response->text(); });
Didn't test the code but try something like this.
$crawler->filter($this->productLinkSelector)->each(function($node) {
$url = $node->attr('href');
$text = $node->text();
});
For more information feel free to have a look here: https://github.com/FriendsOfPHP/Goutte#more-information