-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheadless.patch
More file actions
25 lines (22 loc) · 1.15 KB
/
headless.patch
File metadata and controls
25 lines (22 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff --git a/scrape_garmin.py b/scrape_garmin.py
index 51f17ec..922e3a8 100755
--- a/scrape_garmin.py
+++ b/scrape_garmin.py
@@ -12,6 +12,7 @@ from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
+from selenium.webdriver.firefox.options import Options
import GarminDB
@@ -44,9 +45,11 @@ class Scrape():
fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/zip")
fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream")
fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/x-zip-compressed")
+ opts = Options()
+ opts.set_headless()
geckodriver = os.getcwd() + "/bin/geckodriver"
logger.debug("Creating driver")
- self.browser = webdriver.Firefox(firefox_profile=fp, executable_path=geckodriver)
+ self.browser = webdriver.Firefox(options=opts, firefox_profile=fp, executable_path=geckodriver)
def __del__(self):
self.browser.close()