FriendsOfPHP / Goutte

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

Different filter behavior in Ubuntu and CentOS #336

Open re1naldo opened 6 years ago

re1naldo commented 6 years ago

I tried to scrape data from https://www.nhpassist.com/products using the following code:

$client = new Client();
$crawler = $client->request('GET', https://www.nhpassist.com/products');

return $crawler->filter('h3 > a')->each(function ($node) {
     $elements[] = $node->text();
     return $elements;
});

All brands were scraped properly on my local machine (PHP 7.0.22-0ubuntu0.16.04.1). However, when I ran the script on the remote server (PHP 7.0.27 – Centos 7), not all brands were scraped. Brands like Allimax, Aromtech, Tegor Laboratorios, etc. were not scraped. What caused these different behaviors?