tuhin18003 / puppteer-php-bridge
A PHP Class to interact with Puppeteer and capture screenshot of a webpage
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 1
pkg:composer/tuhin18003/puppteer-php-bridge
Requires
- php: >=5.3
This package is auto-updated.
Last update: 2025-12-14 23:21:41 UTC
README
Web site screenshot tool based on PHP and puppeteer You can use it to take screenshots for testing or monitoring service
Install
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
Usage
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(); }
License
The MIT License (MIT). Please see License File for more information.
Credits
Thanks to the puppeteer (LICENSE) guys for creating their awesome WebKit scripting interface.