phpweb-crawlergoutte

goutte returns The current node list is empty


The code below always returns The current node list is empty.

 $c = $client->request('GET', 'https://mihanblockchain.com/exchange-prices');

    $selector = "[data-coin|='usdt'] tr td#ex-1-buy-price";

    $result = $c->filter($selector)->text();

thanks in advance


Solution

  • Since your last selector is #ex-1-buy-price, which is an unique ID in the page, you don't need everything else

    $selector = "#ex-1-buy-price";
    $result = $c->filter($selector)->text();
    

    This works and returns 840,000,100 تومان