html结构:
<div id="product">
<p>some text</p>
<p>some text2</p>
</div>
我的PHP代码:
$client = new Client();
$crawler = $client->request('GET', $url);
echo $crawler->filter('#product')->text();
返回:
some text some text2
但是我需要:
<p>some text</p>
<p>some text2</p>