Web site screenshot tool based on PHP and puppeteer You can use it to take screenshots for testing or monitoring service
Via Composer
$ composer require tuhin18003/puppteer-php-bridge
After install the composer package go inside the jobs folder, then install the npm package
$ npm install
With this library you can make use of PhantomJs to screenshot a website.
Check our demo or read the following instructions.
Creating the object, you can either pass the url on the constructer or set it later on
use PuppetBridge\Capture;
try{
$screenCapture = new Capture();
$screenCapture->setImageType( 'png' );
$screenCapture->setUrl( 'https://google.com' );
$screenCapture->setTop(0);
$screenCapture->setLeft(0);
$screenCapture->setWidth( '600' );
$screenCapture->setHeight( '600' );
$screenCapture->save( 'images/testimg.png' ); // make sure images folder is writable
} catch (Exception $ex) {
echo $ex->getMessage();
}
The MIT License (MIT). Please see License File for more information.
Thanks to the puppeteer (LICENSE) guys for creating their awesome WebKit scripting interface.