我正在抓取网站,到目前为止,使用Goutte解析HTML没有问题.但我需要从网站检索JSON,并且由于cookie管理,我不想这样做file_get_contents()- 这不起作用.
我可以使用纯cURL但在这种情况下我只想使用Goutte而不想使用任何其他库.
那么有什么方法可以通过Goutte解析文本,或者我真的必须用好的旧方法来做这个吗?
/* Sample Code */
$client = new Client();
$crawler = $client->request('foo');
$crawler = $crawler->filter('bar'); // of course not working
Run Code Online (Sandbox Code Playgroud)
谢谢.