我第一次尝试使用Symfony Panther(Symfony 5.1,Windows 10,我有 Chrome 和 Firefox),但第一行已经无法正常工作。
使用 Github 文档(基本用法),这是我的错误:
$client = \Symfony\Component\Panther\Client::createChromeClient();
// error : session not created: This version of ChromeDriver only supports Chrome version 80
// it's true, my Chrome version is 85. Eventually, I want to disable the sessions for it to work but I don't know how to do it.
Firefox 的第二次尝试:
$client = \Symfony\Component\Panther\Client::createFirefoxClient();
// Error : Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line
第三次尝试使用 Firefox 和二进制:
$client = \Symfony\Component\Panther\Client::createFirefoxClient('C:\Program Files\Mozilla Firefox\firefox');
// my browser opens but nothing happens (blank page)
// PHP error : Could not start firefox (or it crashed) after 30 seconds.