Reputation: 959
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.
Upvotes: 3
Views: 3438
Reputation: 15090
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')
Upvotes: 4