Raden Bagus
Raden Bagus

Reputation: 560

PhantomJS Cannot Render Page but Others Work

I am trying to render this page (https://www.olx.co.id/item/kost-murah-di-jatipadang-poncol-tb-simatupang-jaksel-iid-523802059). However it does not work.

FYI, I can render the other site perfectly. Here is my code.

$client = Client::getInstance();
$client->getEngine()->setPath($_SERVER["DOCUMENT_ROOT"].'/bin/phantomjs');

/** 
 * @see JonnyW\PhantomJs\Http\Request
 **/
$request = $client->getMessageFactory()->createRequest('https://www.olx.co.id/item/kost-murah-di-jatipadang-poncol-tb-simatupang-jaksel-iid-523802059', 'GET');

/** 
 * @see JonnyW\PhantomJs\Http\Response 
 **/
$response = $client->getMessageFactory()->createResponse();

// Send the request
$client->send($request, $response);

print_r($response);
if($response->getStatus() === 200) {

    // Dump the requested page content
    echo $response->getContent();
}

Is there something wrong with my code? Thank you.

Upvotes: 1

Views: 29

Answers (0)

Related Questions