diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-05-06 13:41:19 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-05-06 13:41:19 +0200 |
| commit | f82f65084b77d2e8f9e8be323fedf169270a9824 (patch) | |
| tree | 92cc402f051534f2fdc4866126929e655104ce0c | |
| parent | 91716e9849480017a45396861f93e352cc40b8fd (diff) | |
Selenium: Do not use pyvirtualdisplay, set Firefox to headless
| -rw-r--r-- | selenium_eduvpn.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/selenium_eduvpn.py b/selenium_eduvpn.py index 65c5104..6c91fa5 100644 --- a/selenium_eduvpn.py +++ b/selenium_eduvpn.py @@ -2,7 +2,7 @@ import os import sys from selenium import webdriver from selenium.webdriver.common.keys import Keys -from pyvirtualdisplay import Display +from selenium.webdriver.firefox.options import Options # Logs in to the default vpn user portal with selenium @@ -51,12 +51,11 @@ if __name__ == "__main__": print("Error: no auth url specified") sys.exit(1) - # Start a virtual display using xvfb - disp = Display() - disp.start() + options = Options() + options.headless = True # Use the firefox driver - driver = webdriver.Firefox() + driver = webdriver.Firefox(options=options) # Login to the portal authURL = sys.argv[1] @@ -64,4 +63,3 @@ if __name__ == "__main__": # Cleanup driver.close() - disp.stop() |
