diff --git a/install_python3.sh b/install_python3.sh new file mode 100644 index 0000000000000000000000000000000000000000..5a1e89b82b023d69f03d85140f78aa5accb31351 --- /dev/null +++ b/install_python3.sh @@ -0,0 +1,13 @@ + + + + +wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; +bash miniconda.sh -b -p $HOME/miniconda +export PATH="$HOME/miniconda/bin:$PATH" +hash -r +conda config --set always_yes yes --set changeps1 no +conda update -q conda +conda info -a +pip install -U pip + diff --git a/scrape.py b/scrape.py index 96f7212502294434556130345dd4cb471c140bfc..d9767042c6fbb51b8dd2b3f2b95556c3992970f9 100644 --- a/scrape.py +++ b/scrape.py @@ -58,19 +58,23 @@ options.add_argument("--headless") import os 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) 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=GECKODRIVER_PATH) + try: + #driver = webdriver.Firefox(options=options) + GECKODRIVER_PATH=str(os.getcwd())+str("/geckodriver") + driver = webdriver.Firefox(options=options,executable_path=GECKODRIVER_PATH) + + 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=GECKODRIVER_PATH)