From a965d4f5cf3c6aeb241c31b43aa7c18fc207d5f8 Mon Sep 17 00:00:00 2001 From: Russell Jarvis <rjjarvis@asu.edu> Date: Wed, 24 Jun 2020 10:07:47 +1000 Subject: [PATCH] changes --- scrape.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scrape.py b/scrape.py index fe7a614..81e97a2 100644 --- a/scrape.py +++ b/scrape.py @@ -64,10 +64,8 @@ chrome_options.add_argument("--no-sandbox") driver = webdriver.Chrome(executable_path=os.environ.get("CHROMEDRIVER_PATH"), chrome_options=chrome_options) ''' -#os.system("which firefox") options = Options() -#options.headless = True -options.binary_location = os.environ.get("/app/vendor/firefox/firefox") +options.binary_location = "/app/vendor/firefox/firefox" options.add_argument("--headless") options.add_argument("--disable-dev-shm-usage") options.add_argument("--no-sandbox") @@ -81,17 +79,20 @@ except: try: #driver = webdriver.Firefox(options=options) #GECKODRIVER_PATH=str(os.getcwd())+str("/geckodriver") - driver = webdriver.Firefox(options=options,executable_path=GECKODRIVER_PATH) + driver = webdriver.Firefox(options=options,executable_path="/app/vendor/geckodriver/geckodriver") except: #GECKODRIVER_PATH="/app/vendor/geckodriver/geckodriver" #driver = webdriver.Firefox(options=options,executable_path=GECKODRIVER_PATH) - #os.system("wget wget https://ftp.mozilla.org/pub/firefox/releases/45.0.2/linux-x86_64/en-GB/firefox-45.0.2.tar.bz2") - #os.system("wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz") - #os.system("tar -xf geckodriver-v0.26.0-linux64.tar.gz") - #os.system("tar xvf firefox-45.0.2.tar.bz2") - #GECKODRIVER_PATH=str(os.getcwd())+str("/geckodriver") - driver = webdriver.Firefox(options=options,executable_path="/app/vendor/geckodriver/geckodriver") + os.system("wget wget https://ftp.mozilla.org/pub/firefox/releases/45.0.2/linux-x86_64/en-GB/firefox-45.0.2.tar.bz2") + os.system("wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz") + os.system("tar -xf geckodriver-v0.26.0-linux64.tar.gz") + os.system("tar xvf firefox-45.0.2.tar.bz2") + GECKODRIVER_PATH=str(os.getcwd())+str("/geckodriver") + #FF=str(os.getcwd())+str("firefox") + options.binary_location = str('./firefox') + #driver = webdriver.Firefox(options=options,executable_path=FF) + driver = webdriver.Firefox(options=options,executable_path=GECKODRIVER_PATH) -- GitLab