Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,8 +10,11 @@ from selenium import webdriver
|
|
| 10 |
from selenium.webdriver.chrome.service import Service
|
| 11 |
from selenium.webdriver.common.by import By
|
| 12 |
from selenium.webdriver.chrome.options import Options
|
|
|
|
| 13 |
|
| 14 |
-
PATH_TO_CHROME_DRIVER = '
|
|
|
|
|
|
|
| 15 |
|
| 16 |
class Website:
|
| 17 |
url: str
|
|
@@ -26,7 +29,7 @@ class Website:
|
|
| 26 |
options.add_argument("--no-sandbox")
|
| 27 |
options.add_argument("--disable-dev-shm-usage")
|
| 28 |
|
| 29 |
-
service = Service(PATH_TO_CHROME_DRIVER)
|
| 30 |
driver = webdriver.Chrome(service=service)
|
| 31 |
driver.get(url)
|
| 32 |
|
|
|
|
| 10 |
from selenium.webdriver.chrome.service import Service
|
| 11 |
from selenium.webdriver.common.by import By
|
| 12 |
from selenium.webdriver.chrome.options import Options
|
| 13 |
+
import os
|
| 14 |
|
| 15 |
+
PATH_TO_CHROME_DRIVER = os.path.join(os.getcwd(),'chromedriver.exe')
|
| 16 |
+
|
| 17 |
+
log_file= os.path.join(os.getcwd(),'logs')
|
| 18 |
|
| 19 |
class Website:
|
| 20 |
url: str
|
|
|
|
| 29 |
options.add_argument("--no-sandbox")
|
| 30 |
options.add_argument("--disable-dev-shm-usage")
|
| 31 |
|
| 32 |
+
service = Service(executable_path=PATH_TO_CHROME_DRIVER , log_output=log_file)
|
| 33 |
driver = webdriver.Chrome(service=service)
|
| 34 |
driver.get(url)
|
| 35 |
|