Goutte
Goutte copied to clipboard
Different filter behavior in Ubuntu and CentOS
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?