Использую библиотеку HeadlessChromium для php подскажите как сделать click через xpath.
привожу свой код
require_once('vendor/autoload.php');
use HeadlessChromium\BrowserFactory;
use HeadlessChromium\Input\Mouse;
use HeadlessChromium\Communication\Connection;
use HeadlessChromium\Communication\Message;
$browserFactory = new BrowserFactory("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe");
// starts headless chrome
$browser = $browserFactory->createBrowser([
'headless' => true, // disable headless mode
'windowSize' => [663, 558],
'enableImages' => false,
'sendSyncDefaultTimeout' => 30000000,
'mouse' => true // will enable verbose mode
]);
$page = $browser->createPage();
$uri = 'https://saite.ru';
$page->navigate($uri)->waitForNavigation();
$pageTitle = $page->evaluate('document.title')->getReturnValue();
echo $pageTitle;
$evaluation = $page->evaluate('document.documentElement.innerHTML')->getReturnValue();
echo $evaluation;