Does running a Python Web-automation script written in Selenium require modifications for running on a VPS (virtual private server)?
Asked
Active
Viewed 149 times
1 Answers
0
One of the problems you can face is the lack of graphical interface on most of VPS servers. You can easily manage using headless mode if you are using chromedriver, for example:
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox') # required when running as root user. otherwise you would get no sandbox errors.
driver = webdriver.Chrome(driver_path='/home/dev/chromedriver', chrome_options=chrome_options,
service_args=['--verbose', '--log-path=/tmp/chromedriver.log'])
Also, check the anwser to a similar question: How to fix WebDriverException: The browser appears to have exited before we could connect?

Sabito stands with Ukraine
- 4,271
- 8
- 34
- 56

giotr
- 106
- 1
- 2