-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathping_app.py
More file actions
31 lines (26 loc) · 1.05 KB
/
ping_app.py
File metadata and controls
31 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from datetime import datetime
import time
URL = "https://404-inventory.streamlit.app/"
def ping_streamlit():
options = Options()
options.add_argument("--headless")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
driver = webdriver.Chrome(options=options)
try:
driver.get(URL)
# Esperar hasta que el título de la página contenga "Material"
WebDriverWait(driver, 360).until(EC.presence_of_element_located((By.XPATH, "//*[contains(text(), 'Material')]")))
print(f"[{datetime.utcnow()}] ✅ Page loaded: {URL}")
except Exception as e:
print(f"[{datetime.utcnow()}] ❌ Timed out or error: {e}")
finally:
driver.quit()
if __name__ == "__main__":
print(f"Starting .get({URL})")
ping_streamlit()