Skip to main content

How to take screenshots using Puppeteer and Headless Chrome

Comments

1 comment

  • Matthias Van Woensel

    If you don’t want to use nodejs for it but prefer php, check out https://github.com/rialto-php/puphpeteer

    use Nesk\Puphpeteer\Puppeteer;
    
    $puppeteer = new Puppeteer;
    $browser = $puppeteer->launch();
    
    $page = $browser->newPage();
    $page->goto('https://example.com');
    $page->screenshot(['path' => 'example.png']);
    
    $browser->close();```
    0

Please sign in to leave a comment.