I want to scrape this:
<a class="pdt_title">
Japan Sun Apple - Fuji
<span class="pdt_Tweight">2 per pack</span>
</a>
This is my code:
use Goutte\Client;
$client = new Client();
$crawler = $client->request('GET', 'https://www.fairprice.com.sg/searchterm/apple');
foreach ($crawler->filter('a.pdt_title') as $node) {
print $node->nodeValue."\n";
}
I only want to scrape the text inside "a" tag without the text inside "span" tag. How to only get the text inside "a" tag?