PHP code example of highscore / browser

1. Go to this page and download the library: Download highscore/browser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

highscore / browser example snippets



use Laravel\Dusk\Browser;

$browser = Browser::configure()
    ->headless()
    ->singleProcess()
    ->host('http://127.0.0.1')
    ->port(9515)
    ->enableRequestLog()
    ->storeScreenshotsAt(storage_path('app/'))
    ->size(1280, 720)
    ->agent('MyCustomAgent 1.0')
    ->proxy('http://proxyurl:9510')
    ->allowDownloadsTo('/tmp')
    ->grantAllPermisions('http://www.google.com')
    ->lang('es')
    ->make();

dump($browser->visit('http://www.google.com')
    ->javascript('return document.title'));


$browser
    ->waitDocumentLoad()
    ->waitFontLoad()
    ->waitForVisible('//img')
    ->waitForClickable('button')
    ->transparentScreenshot('transparent-screenshot');

dump($browser->getNetworkEvents());
dump($browser->html());