php-casperjs icon indicating copy to clipboard operation
php-casperjs copied to clipboard

error when install php-casperjs

Open foxpcteam opened this issue 7 years ago • 1 comments

Hi, when i try to install the php-casperjs i get this error: Fatal error: Call to undefined function Symfony\Polyfill\Mbstring\iconv() in phar:///opt/cpanel/composer/bin/composer/vendor/symfony/polyfill-mbstring/Mbstring.php on line 513

foxpcteam avatar Oct 23 '16 06:10 foxpcteam

i found the problem. Mbstring was missing. now i have another question. after i have install using composer. i create new php file and add example code:

<?php

use Browser\Casper;

$casper = new Casper();

// forward options to phantomJS
// for example to ignore ssl errors
$casper->setOptions(array(
    'ignore-ssl-errors' => 'yes'
));

// navigate to google web page
$casper->start('http://www.google.com');

// fill the search form and submit it with input's name
$casper->fillForm(
        'form[action="/search"]',
        array(
                'q' => 'search'
        ),
        true);
// run the casper script
$casper->run();

// check the urls casper get through
var_dump($casper->getRequestedUrls());

// need to debug? just check the casper output
var_dump($casper->getOutput());

when i try to run the php code i get this error: "Not supported" and in the console i see "Failed to load resource: the server responded with a status of 501 (Not Implemented)"

foxpcteam avatar Oct 23 '16 08:10 foxpcteam