FriendsOfPHP / Goutte

Goutte, a simple PHP Web Scraper
MIT License
9.26k stars 1.01k forks source link

How to get this image? #438

Closed katesaikishore closed 2 years ago

katesaikishore commented 3 years ago
$client = new Client();

$crawler = $client->request('GET', 'https://factly.in/category/english/'); $data = $crawler->filter('h2 > a')->each(function ($node) { var_dump($node->text()); }); echo $crawler->filter('.image img')->attr('src');

I have used this code but couldn't get the image showing error: The current node list is empty.

Screenshot 2021-02-08 at 2 25 41 PM