我尝试了这段代码。我没有添加无意义的论点。 但是我看不到webdriver浏览器。以前,我可以看到它。 但是,现在突然我看不到了。有人知道为什么看不到吗?
$process = (new ChromeProcess)->toProcess();
if ($process->isStarted()) {
$process->stop();
}
$process->start();
$options = (new ChromeOptions)->addArguments(['--disable-gpu','--no-sandbox']);
$capabilities = DesiredCapabilities::chrome()
->setCapability(ChromeOptions::CAPABILITY, $options)
->setPlatform('Windows');
$driver = retry(5, function () use ($capabilities) {
return RemoteWebDriver::create('http://localhost:9515', $capabilities, 60000, 60000);
}, 50);
$browser = new Browser($driver, new ElementResolver($driver, ''));