Search code examples
phpsymfonyweb-crawlergoutte

Goutte Crawler can't get certain classname values


I'm trying to get an array of product names from a website. I'm using fabpot/goutte. I'm able to get certain class values from the website, but when I try to get the product name or the price of the product I get something like this {{ProductName}}.

Here is my code:

$client = new \Goutte\Client();

$crawler = $client->request('GET','http://www.thefirestore.com/store/category.aspx/categoryId/577/1010-Helmets-Cairns-Helmets/#/orderby/9');
$crawler->filter('.product-name')->each(function ($node){
  echo $node->text().'<br>';
});

Thank you,


Solution

  • That's because the html of page return just a template, and the products data are served via api, so you dont even need a crawler to get the list of products, just make a GET on his api.

    request

    data