Answer the question
In order to leave comments, you need to log in
How to set up a virtual browser (Selenium) in PHP?
Hello, has anyone worked with Selenium in PHP?
Can't figure out the initial setup.
I run java -Dwebdriver.chrome.driver=chromedriver -jar selenium-server-standalone-2.48.2.jar I
use the package https://github.com/facebook/php-webdriver
I execute
similar lines
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
$host = 'http://localhost:4444/wd/hub'; // this is the default
$desired_capabilities = DesiredCapabilities::chrome();
$driver = RemoteWebDriver::create($host, $desired_capabilities);
$driver->get('https://google.com');
$title = $driver->getTitle();
Facebook\WebDriver\Exception\WebDriverCurlException
Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY"}}
Operation timed out after 30001 milliseconds with 0 bytes received
Answer the question
In order to leave comments, you need to log in
If there are no error messages after running
in another SSH window, check that it has started
. Try replacing localhost with 127.0. like on modern systems localhost means ::1, there is a suspicion that there are problems with ipv6.
Also try adding flags to parse the error:
java -Dwebdriver.chrome.driver=chromedriver -Dwebdriver.chrome.args="--logging-level=3" -jar selenium-server-standalone-2.48.2.jar --verbose
How was the problem resolved?
Exactly the same question How to properly run Selenium on a VPS?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question