Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -16,6 +16,7 @@ from selenium.webdriver.chrome.options import Options
|
|
16 |
from selenium.webdriver.common.by import By
|
17 |
from selenium.webdriver.support.ui import WebDriverWait
|
18 |
from selenium.webdriver.support import expected_conditions as EC
|
|
|
19 |
from webdriver_manager.chrome import ChromeDriverManager
|
20 |
|
21 |
def get_raw_data(station_id):
|
@@ -85,8 +86,9 @@ def scrape_snow_depth():
|
|
85 |
chrome_options.add_argument("--no-sandbox")
|
86 |
chrome_options.add_argument("--disable-dev-shm-usage")
|
87 |
|
88 |
-
# Initialize Chrome using
|
89 |
-
|
|
|
90 |
|
91 |
driver.get(url)
|
92 |
|
|
|
16 |
from selenium.webdriver.common.by import By
|
17 |
from selenium.webdriver.support.ui import WebDriverWait
|
18 |
from selenium.webdriver.support import expected_conditions as EC
|
19 |
+
from selenium.webdriver.chrome.service import Service
|
20 |
from webdriver_manager.chrome import ChromeDriverManager
|
21 |
|
22 |
def get_raw_data(station_id):
|
|
|
86 |
chrome_options.add_argument("--no-sandbox")
|
87 |
chrome_options.add_argument("--disable-dev-shm-usage")
|
88 |
|
89 |
+
# Initialize Chrome using the Service object (Selenium 4+)
|
90 |
+
service = Service(ChromeDriverManager().install())
|
91 |
+
driver = webdriver.Chrome(service=service, options=chrome_options)
|
92 |
|
93 |
driver.get(url)
|
94 |
|