2
我想從這個url與Goutte 的數據但是當我試圖過濾只有類「empresa」的div,我得到整個頁面。 如何過濾只有特定類的div?與豆類的類與獲得div
這是我的代碼:
<html>
<body>
<?php
require __DIR__ . '/vendor/autoload.php';
use Goutte\Client;
$client = new Client();
$crawler = $client->request('GET', 'http://sp.cadastrosindustriais.com.br/?consulta=cal%C3%A7ados');
$crawler->filter('div[id="empresa"]')->each(function ($node) {
print $node->text()."\n";
});
?>
</body>
</html>