FriendsOfPHP / Goutte

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

I didn't getting all the anchor tag #363

Open richasugandhi opened 5 years ago

richasugandhi commented 5 years ago

Hello,

I didn't getting all the anchor tag of url. $client = new Client(); $crawler = $client->request('GET', 'https://css-tricks.com/ '); $anchorTagValue = $crawler->filter('a'); echo count($anchorTagValue);

Like I have used this url "https://css-tricks.com/" but I got count anchor tag is "3".

Please help me.

M4Lien commented 5 years ago

Hi Please use this code instead of $anchorTagValue = $crawler->filter('a'); $anchorTagValue = $crawler->filter('a')->text(); $anchorTagValue = $crawler->filter('a')->attr('href);