How can i run a python script using selenium (chromedriver) in an terminal window (without X forwarding).
The results/interactions with the website don't need to be shown. Par example filling a form scheduled by a cronjob.
you can use PyVirtualDisplay with Xvfb
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(800, 600))
display.start()
# now Chrome will run in a virtual display.
browser = webdriver.Chrome()
browser.get('http://www.google.com')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With