1

I am having an issue getting an image from a page. Some pages have it some don't. On the ones that don't i get the current node list is empty error.

I am doing !empty($crawler->filter('.listing-logo > img')->attr('src')) but it still returns the exception.

I've tried doing it with a ->count() but it won't allow that on a string. I've also used strlen but it still sends back the empty.

$client = new Goutte\Client();
        $crawler = $client->request('GET', $item->data['child']['']['guid'][0]['data']);
dd(!empty($crawler->filter('.listing-logo > img')->attr('src')));
TheDizzle
  • 1,534
  • 5
  • 33
  • 76

0 Answers0