PHP code example of playwright-php / playwright-mink
1. Go to this page and download the library: Download playwright-php/playwright-mink 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/ */
playwright-php / playwright-mink example snippets
use Behat\Mink\Session;
use Playwright\Mink\Driver\PlaywrightDriver;
$driver = new PlaywrightDriver(
browserType: 'chromium',
headless: true,
);
$session = new Session($driver);
$session->start();
try {
$session->visit('https://example.com');
echo $session->getPage()->getText();
} finally {
$session->stop();
}