Reputation: 53
I want to parse the HTML from this site, I already try to use :
but the result is awful like this :
then I try PHP CURL by using php html parser, I found the error is SSL certificate problem: unable to get local issuer certificate
After searching the answer, then I read using curl to access https, and I try to get the certificate by using the step in that article but the result is same
the question is, why the parsing result is like that? now, I don't know what to do :(
Upvotes: 1
Views: 1523
Reputation: 66
The page is compressed with gzip.
curl -k --compressed https://inaproc.lkpp.go.id/v3/daftar_lpse
For PHP
$ch = curl_init("https://inaproc.lkpp.go.id/v3/daftar_lpse");
curl_setopt($ch, CURLOPT_ENCODING , "");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
Upvotes: 5