Answer the question
In order to leave comments, you need to log in
How to properly run Selenium on a VPS?
Please tell me about the correct launch of Selenium on a remote machine with Debian.
I just do:
java -jar selenium-server-standalone-2.53.0.jar -Dwebdriver.chrome.driver=chromedriver
<?php
// Указываем пространство имен
namespace Facebook\WebDriver;
// Указываем какие классы будут использоватся
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
//Пподключаем автолоадер классов
require_once('vendor/autoload.php');
// Задаем хост на котором запущен Selenium (localhost - если же на этом компьютере) и номер порта (4444 - порт по умолчанию, если мы не задали другой)
$host = 'http://[мой_ip]:4444/wd/hub';
$driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());
// Подаем команду браузеру переход на URL: 'http://docs.seleniumhq.org/'
$driver->get('http://docs.seleniumhq.org/');
Answer the question
In order to leave comments, you need to log in
Selenium is running without a monitor - the browser can't start and I get this error.
To run full browsers on a VPS, you can use xvfb-run. As an example run:
Read more about this article:
ermin.ru/post/19
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question