0
<?php
require_once '/var/www/goutte.phar';
use Goutte\Client;
$guzzle = parent::getClient(); //You'll want to pull the Guzzle client out of Goutte to inherit its defaults
$guzzle->setDefaultOption('verify', '/path/to/cacert.pem'); //Set the certificate at @mtdowling recommends
$client->setClient($guzzle); //Tell Goutte to use your modified Guzzle client
$crawler = $client->request('GET', 'https://ocean.ac-guadeloupe.fr/publinet/resultats'); //Proceed as you were
var_dump($crawler);
?>
当我运行上面的代码时,出现错误“无法访问父::当没有类作用域是活动”。那么如何从Goutte访问Guzzle属性?如何更改goutte的guzzle属性?
我不确定为什么你被低估了。我遇到了问题,以绕过一些ssl自我认证问题。我遵循你所说的,但是改变了('验证','路径/到/证书')到('验证',假),它的工作就像一个魅力。 –