尝试使用Guzzle客户端($request = $client->getClient()->createRequest('GET', 'http://.../api');
$response = $request->send();
$json_data = $response->json();
)
[Symfony\Component\Debug\Exception\FatalThrowableError]
Type error: Argument 3 passed to GuzzleHttp\Client::request() must be of the type array,
string given, called in /var/www/.../vendor/guzzlehttp/guzzle/src/Client.php on line 87
错误:
$crawler = $client->request("GET", "http://.../api");
$json_data = $crawler->text();
尝试使用抓取工具
[InvalidArgumentException]
The current node list is empty.
错误:
Federkun
修改
请参阅$json_data = $client->getResponse()->getContent();
的评论。
解决方案:
{{1}}