PHP code example of luka-dev / playwright-php
1. Go to this page and download the library: Download luka-dev/playwright-php 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/ */
luka-dev / playwright-php example snippets
$connectionConfig = new \ConnectionConfig('localhost');
$contextConfig = new ContextConfig();
$contextConfig->setUserAgent('Custom UserAgent');
$contextConfig->setProxy(
'protocol://address:port',
null,
'username',
'password'
);
$taskServer = new \TaskServer($connectionConfig, $contextConfig);
$script = new Context();
$page = $script->newPage();
$page->goto('https://2ip.ru/');
$element = $page->query('div.ip');
$element->textContentToVar('ip');
$script->resolve('ip');
$response = $taskServer->runTask($script);
bash
composer