小编mit*_*mus的帖子

可以用Goutte解析JSON吗?

我正在抓取网站,到目前为止,使用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)

谢谢.

php json html-parsing goutte

4
推荐指数
1
解决办法
4805
查看次数

标签 统计

goutte ×1

html-parsing ×1

json ×1

php ×1