Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Farooq committed Jan 10, 2021
1 parent 6875fc9 commit 22ece8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from selenium.webdriver.common.keys import Keys

from .scrapper import scrape_settings,scrape_properties
from django.conf import settings
import os

@api_view(["POST"])
Expand All @@ -38,13 +39,14 @@ def login(request):
key=request.META['HTTP_AUTHORIZATION']
user_email = request.data['email']
user_password=request.data['password']

print(settings.CHROMEDRIVER_PATH)
print(settings.CHROME_BIN)
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--no-sandbox")
chrome_options.binary_location = os.environ.get("GOOGLE_CHROME_BIN")
selenium = webdriver.Chrome(executable_path=os.environ.get("CHROMEDRIVER_PATH"), chrome_options=chrome_options)
chrome_options.binary_location = settings.CHROME_BIN
selenium = webdriver.Chrome(executable_path=settings.CHROMEDRIVER_PATH, chrome_options=chrome_options)

#selenium = webdriver.Chrome(ChromeDriverManager().install(),chrome_options=chrome_options)
selenium.get('https://app.earth2.io/login/auth0')
Expand Down
4 changes: 2 additions & 2 deletions earth2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import dj_database_url
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


CHROME_BIN = os.environ.get("GOOGLE_CHROME_BIN")
CHROMEDRIVER_PATH = os.environ.get("CHROMEDRIVER_PATH")
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/

Expand Down

0 comments on commit 22ece8e

Please sign in to comment.