Closed lava83 closed 3 years ago
Hello, I have the same issue here on CentOS 7. How to correctly launch Chrome and navigate, please?
Here I had to yum install chromium
Or apt-get install chromium
on some distros 🙄
This issue can be closed I guess.
Is there a solution if you can not use yum
nor apt-get
on the machine you want to run the PHP file? We can not run either of them on our NAS nor on our managed servers.
@michaelKaefer You can set path of $chromeDriverBinary
when you create your Chrome client :
https://github.com/symfony/panther/blob/770cfeeb57da4ba85f809652a5af8b56bc1cba18/src/Client.php#L58
\Symfony\Component\Panther\Client::createChromeClient('/path/of/your/chrome/driver/on/your/env');
Binaries are here : https://github.com/symfony/panther/tree/master/chromedriver-bin
On Laravel controller this code works corectly
$client = Client::createChromeClient(base_path("drivers/chromedriver"), null, ["port" => rand(1000, 9999)]); // create a chrome client
$crawler = $client->request('GET', $url);
but whenr I am trying to run it in Job, this error occurs Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: Chrome failed to start: exited normally.
(session not created: DevToolsActivePort file doesn't exist)
(The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) in
Hy,
on a new installation, I'll testing the example request code on a laravel installation and will become, with the default configuration the following error:
unknown error: cannot find Chrome binary (Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Linux 4.4.0-131-generic x86_64)
The binaries are avalaible and executable. I've tested the chromium X64 binary for linux on the command line interface and can resolve the status from the server.
For the completenes here the code to test
symfony/panther
: